unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hWnd:integer;<br> TaskBarHWN:integer;<br>begin<br> hWnd:=FindWindow('Shell_TrayWnd','');<br> TaskBarHWN:=Findwindow('Shell_TrayWnd',nil);<br> if hWnd<>0 then<br> begin<br> if not showwindow(hwnd,sw_hide) then<br> begin<br> ShowWindow(hWnd,SW_show);<br> end;<br> end;<br> if not SetWindowPos(TaskBarHWN,0,0,0,0,0,SWP_HIDEWINDOW) then<br> SetWindowPos(TaskBarHWN,0,0,0,0,0,SWP_SHOWWINDOW);<br>end;<br>end.<br>//D6测试通过