利用Delphi全面控制Windows任务栏
//得到任务栏通知区的窗口句柄;?
Wnd[3]:=FindWindow(′ShellTrayWnd′,nil);?
Wnd[3]:=FindWindowEx(Wnd[3],HWND(0),′TrayNotifyWnd′,nil);?
//得到任务栏时钟的窗口句柄;?
Wnd[4]:=FindWindow(′ShellTrayWnd′,nil);?
Wnd[4]:=FindWindowEx(Wnd[4],HWND(0),′TrayNotifyWnd′,nil);?
Wnd[4]:=FindWindowEx(Wnd[4],HWND(0),′TrayCLockWClass′,nil);?
end;?
(4)EnableOrDisable过程代码如下:?
procedure TForm1.EnableOrDisable(Sender:TOBject);?
begin?
GetHandles;?
if TCheckBox(Sender). Checked then?
case TCheckBox(Sender). Tag of?
0: EnableWindow(Wnd[0], False);?
1: EnableWindow(Wnd[1], False);?
2: EnableWindow(Wnd[2], False);?
3: EnableWindow(Wnd[3], False);?
4: EnableWindow(Wnd[4], False);?
end?
else?
case TCheckBox(Sender). Tag of?
0: EnableWindow(Wnd[0], True);?
1: EnableWindow(Wnd[1], True);?
2: EnableWindow(Wnd[2], True);?
3: EnableWindow(Wnd[3], True);?
4: EnableWindow(Wnd[4], True);?
end;?
end;?
(5)HideOrShow过程代码如下:?
procedure TForm1.HideOrShow(Sender:TObject);?
begin?
GetHandles;?
if TCheckBox(Sender). Checked then?
case TCheckBox(Sender). Tag of?
0: ShowWindow(Wnd[0],SWHIDE);?
1: ShowWindow(Wnd[1],SWHIDE);?
2: ShowWindow(Wnd[2],SWHIDE);?
3: ShowWindow(Wnd[3],SWHIDE);?
4: ShowWindow(Wnd[4],SWHIDE);?
end?
else?
《利用Delphi全面控制Windows任务栏(第2页)》