protected
procedure MinimizeProc(Sender: TObject);procedure TForm1.FormCreate(Sender: TObject);
begin
applicatio.minimize := MinimizeProc;
end;procedure TForm1.MinimizeProc(Sender: TObject);
begin
ShowWindow(Hanlde,SW_HIDEWINDOW);
end;
procedure MinimizeProc(Sender: TObject);procedure TForm1.FormCreate(Sender: TObject);
begin
applicatio.minimize := MinimizeProc;
end;procedure TForm1.MinimizeProc(Sender: TObject);
begin
ShowWindow(Hanlde,SW_HIDEWINDOW);
end;
TForm1 = class(TForm)
private
procedure ONMin(var Message:TMessage);Message WM_SYSCOMMAND;
end;procedure TForm1.ONMin(var Message: TMessage);
begin
if Message.Wparam=SC_MINIMIZE then application.Minimize
else inherited;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree//就可以实现.
end;
如果不是的话,你还是把子窗体关闭或隐藏就可以实现了.
当点击最小化按钮时,只要取的最小化的信息就可以.你重载掉WM_SYSCOMMAND消息
procedure mymsg(var msg:TMSG); message WM_SYSCOMMAND;procedure tform1.mymsg(var msg:TMSG);
begin
case msg.wParam of
SC_MAXIMIZE:// Maximizes the window.
SC_MINIMIZE:// Minimizes the window.
..................................
end;
end;