扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
procedure TForm1.GetHandles; begin //得到Tray Bar的窗口句柄; Wnd[0]:=FindWindow(′ShellTrayWnd′,nil); //得到开始按钮的窗口句柄; Wnd[1]:=FindWindow(′ShellTrayWnd′,nil); Wnd[1]:=FindWindowEx(Wnd[1],HWND(0),′Button′,nil); //得到应用程序切换区的窗口句柄; Wnd[2]:=FindWindow(′ShellTrayWnd′,nil); Wnd[2]]:=FindWindowEx(Wnd[2],HWND(0),′ReBarWindow32′,nil); //得到任务栏通知区的窗口句柄; 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; |
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; |
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 case TCheckBox(Sender). Tag of 0: ShowWindow(Wnd[0],SWShow); 1: ShowWindow(Wnd[1],SWShow); 2: ShowWindow(Wnd[2],SWShow); 3: ShowWindow(Wnd[3],SWShow); 4: ShowWindow(Wnd[4],SWShow); end; end; |
procedure TForm1.FormClose(Sender:TObject; var Action: TCloseAction); var i:Integer; begin for i:=0 to 4 do begin EnableWindow(Wnd[i],True); ShowWindow(Wnd[i],SWShow); end; end; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者