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
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;
(6)FormClose事件代码如下://将Windows任务栏恢复到正常状态;
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;