Код:
TMainForm = class(TForm)
...
private
{ Private declarations }
procedure WMSysCommandMy(var Message: TWMSysCommand); message WM_SYSCOMMAND;
public
{ Public declarations }
end;
...
procedure TMainForm.WMSysCommandMy;
begin
with Message do
begin
if (CmdType and $FFF0 = SC_MINIMIZE) and (Application.MainForm = Self) then
ShowMessage('Minimizing')
else inherited;
end;
end;
вместо ShowMessage('Minimizing') вставляешь что-то типа Self.Hide =))))