如何去除Windows的任务栏,不是隐藏!(200分)

Q

qqxia

Unregistered / Unconfirmed
GUEST, unregistred user!
如何去除Windows的任务栏,不是隐藏!
::ShowWindow:):FindWindow("Shell_TrayWnd",NULL),SW_HIDE);这一句没有效果!
我的要求是我的程序在运行的时候,看不到任务栏,当我的程序退出的时候任务栏恢复!
 
procedure hidetitlebar;
var save:longint;
begin
if borderstyle=bsnone then exit;
save:=getwindowlong(handle,gwl_style);
if(save and ws_caption)=ws_caption then
begin
case borderstyle of
bssingle,bssizeable:setwindowlong(handle,gwl_style,save and(not(ws_caption))or
ws_border);
bsdialog:setwindowlong(handle,gwl_style,save and(not(ws_caption))or ds_modalframe or
ws_dlgframe);
end;
height:=height-getsystemmetrics(sm_cycaption);
refresh;
end;
end;
procedure showtitilebar;
var
save:longint;
begin
if boderstyle=bsnone then exit;
save:=getwindowlong(handle,gwl_style);
if (save and ws_caption)<>ws_caption then
begin
case boderstyle of
bssingle,bssizeable :setwindowlong(handle,gwl_style,save or ws_caption or ws_border);
bsdialog:setwindowlong(handle,gwl_style,save or ws_caption or ds_modalframe or
ws_dlgframe);
end;
height:=height+getsystemmetrics(sm_cycaption);
refresh;
end;
end;
 
handle:=Findwindow(nil,'sys ptray');
showwindow(handle,sw_hide);
大致是这么个方法吧
 
在你的程序运行后将explorer.exe进程结束,
当程序退出时再运行 explorer.exe就可以了。
 
to ccweifen: 你这个方法不好.会引起许多问题.
 
有问题吗?
在客户的工控机上为了防止操作员玩游戏,我就是这么做的。
他们连监控程序也无法退出:)
 
procedure TForm1.FormCreate(Sender: TObject);
var handle :thandle;
begin
handle := findwindow('Shell_TrayWND',nil);
if handle <>0 then
showwindow(handle,sw_hide);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var handle:thandle;
begin
handle := findwindow('Shell_TrayWND',nil);
if handle <>0 then
showwindow(handle,sw_show);
end;
 
顶部