🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #146

Minimize applications with modal forms active in D5

#146
From: Alexandru Vulpe
Date: Sun, 14 Mar 2004 15:01
34 lines
1893 bytes
How to minimize application with modal forms active in D5.

Define in public section of your form:

AppState, FormState : TWindowState;
procedure WMSysCommand(var Message: TWMSysCommand); message
WM_SYSCOMMAND;

in implementation section :

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
  case Message.CmdType and $FFF0 of
   SC_MINIMIZE : begin
                  AppState := MainForm.WindowState; 
                  FormState := Self.WindowState;
                  Self.WindowState := wsMinimized;
                  MainForm.WindowState := wsMinimized; // for D5
                  // for D7 works Application.Minimize i guess ;)
                 end;
  SC_RESTORE : begin
                  MainForm.WindowState := AppState;
                  Self.WindowState := FormState;
               end;
  else inherited;
  end;
end;

Now, when I press minimize icon on the title of the modal form the
entire application is minimized.
When I restore the application, the form is also restored.

Regards,
Alex.
Technical Details
Message-ID: <6088e078.0403140701.3f893178@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,386544d3d8eb1316,start
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2004-03-14 07:01:59 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail
From: foxy@mail.md (Alexandru Vulpe)
Newsgroups: borland.public.delphi.language.objectpascal
Subject: Minimize applications with modal forms active in D5
Date: 14 Mar 2004 07:01:58 -0800
Organization: http://groups.google.com
Lines: 34
Message-ID: <6088e078.0403140701.3f893178@posting.google.com>
NNTP-Posting-Host: 213.233.99.106
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1079276519 21326 127.0.0.1 (14 Mar 2004 15:01:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 14 Mar 2004 15:01:59 +0000 (UTC)