Capture Maximize/Minimize Menu button click

Submitted by:Pitter Alderson

Date added:25 October, 2011

Category:Delphi

If you want to react on user maximizing or minimizing a Delphi form, use the code.

Tags: capture button click

Code Snippet:

public
procedure WMSysCommand
(var Msg: TWMSysCommand) ;
message WM_SYSCOMMAND;
...
implementation
...
procedure TForm1.WMSysCommand;
begin
if (Msg.CmdType = SC_MINIMIZE) or
(Msg.CmdType = SC_MAXIMIZE) then
MessageBeep(0) ;
DefaultHandler(Msg) ;
end;
 
 

Comments