In an application I have a modal form, and, when user clicks on minimize button of that form, I want the whole Application, not just that form, to be minimized.
In Delphi, on Windows, I achieve this behavior this way:
...
private
procedure WmSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
...
procedure TForm2.WmSysCommand(var Msg: TWMSysCommand);
begin
if msg.CmdType = SC_MINIMIZE then
Application.Minimize
else
inherited;
end;
In Lazarus, when I cannot use Windows message, what can I do to achieve this?