Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

Capture Maximize/Minimize Menu button click

By Zarko Gajic, About.com

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

~~~~~~~~~~~~~~~~~~~~~~~~~
...
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;

~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» Enlarge a Form Over Screen Size
« Checking If File Is In Use

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 1999 Delphi Tips
  7. Capture Maximize/Minimize Menu button click

©2009 About.com, a part of The New York Times Company.

All rights reserved.