private { Private declarations } procedure WndProc(var Msg: TMessage); ... procedure TForm1.WndProc(var Msg: TMessage); begin if (Message.Msg = WM_SYSCOMMAND) and (wParam = SC_RESTORE) then ... inherited; end;