unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure WMSysCommand(var msg:Tmessage);
message wm_syscommand;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.onSysCommand(var msg: Tmessage);
begin
if msg.cmdtype=SC_MINIMIZE then//如果最小化
your func;
inherited;
end;
end.