procedure TForm1.FormCreate(Sender: TObject);
begin
Wnd[0]:=FindWindow('Shell_TrayWnd',nil);
Wnd[1]:=FindWindowEx(Wnd[0],HWND(0),'Button',nil);
Wnd[2]:=FindWindow('Shell_TrayWnd',nil);
Wnd[2]:=FindWindowEx(Wnd[2],HWND(0),'ReBarWindow32',nil);
Wnd[3]:=FindWindow('Shell_TrayWnd',nil);
Wnd[3]:=FindWindowEx(Wnd[3],HWND(0),'TrayNotifyWnd',nil);
Wnd[4]:=FindWindow('Shell_TrayWnd',nil);
Wnd[4]:=FindWindowEx(Wnd[4],HWND(0),'TrayNotifyWnd',nil);
Wnd[4]:=FindWindowEx(wnd[4],HWND(0),'TrayCLockWClass',nil);
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
EnableWindow(wnd[1],True );
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
EnableWindow(wnd[1],False );
end;
procedure TForm1.btn3Click(Sender: TObject);
begin
ShowWindow(wnd[1],SW_NORMAL );
end;
procedure TForm1.btn4Click(Sender: TObject);
begin
ShowWindow(wnd[1],SW_HIDE );
end;
procedure TForm1.btn7Click(Sender: TObject);
begin
EnableWindow(wnd[2],True );
end;
procedure TForm1.btn8Click(Sender: TObject);
begin
EnableWindow(wnd[2],False );
end;
procedure TForm1.btn5Click(Sender: TObject);
begin
ShowWindow(wnd[2],SW_NORMAL );
end;
procedure TForm1.btn6Click(Sender: TObject);
begin
ShowWindow(wnd[2],SW_HIDE );
end;
procedure TForm1.btn9Click(Sender: TObject);
begin
EnableWindow(wnd[3],True );
end;
procedure TForm1.btn11Click(Sender: TObject);
begin
EnableWindow(wnd[3],False );
end;
procedure TForm1.btn10Click(Sender: TObject);
begin
ShowWindow(wnd[3],SW_NORMAL );
end;
procedure TForm1.btn12Click(Sender: TObject);
begin
ShowWindow(wnd[3],SW_HIDE );
end;
procedure TForm1.btn13Click(Sender: TObject);
begin
EnableWindow(wnd[4],True );
end;
procedure TForm1.btn15Click(Sender: TObject);
begin
EnableWindow(wnd[4],False );
end;
procedure TForm1.btn14Click(Sender: TObject);
begin
ShowWindow(wnd[4],SW_SHOWNORMAL);
end;
procedure TForm1.btn16Click(Sender: TObject);
begin
ShowWindow(wnd[4], SW_HIDE );
end;
/**********************************************
***********************************************/
procedure TForm1.btn1Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Progman', nil); {Progman 是桌面窗口的类名}
ShowWindow(h, SW_HIDE)
end;
procedure TForm1.btn2Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Progman', nil); {Progman 是桌面窗口的类名}
ShowWindow(h, SW_RESTORE );
end;