procedure TForm1.Button1Click(Sender: TObject);
begin
enablewindow(handle,false);//窗口一不可用
form2.show;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
enablewindow(form1.handle,true);//可用
end;
或者
var
Form1: TForm1;
WindowList: Pointer;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
WindowList:= DisableTaskWindows(self.handle);
form2.show;
end;
uses Unit1;
{$R *.DFM}
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
EnableTaskWindows(unit1.WindowList);
end;