I found 2 ways to catch onMinimize event.
First: in the FormResize event:
if MyForm.WindowState = wsMinimized then ......
Second: Declaring a message handler as follows:
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 ?!
source
share