I found 2 ways for catching onMinimize event.
First: On FormResize event:
if MyForm.WindowState = wsMinimized then ......
Second: Declaring the message handler like this:
procedure WMSize(var Msg: TMessage); message WM_SIZE;
And then:
procedure TForm57.WMSize(var Msg: TMessage);
begin
if Msg.WParam = SIZE_MINIMIZED then ....
end;
Which way is better?!