[DUG] Minimising a form and Application
John Bird
johnkbird at paradise.net.nz
Sat Dec 5 14:16:00 NZDT 2009
I am puzzled about the Delphi default - if an application has multiple
forms, and a form that is not the main form is shown and is mimimised, then
the default behaviour is for that form to minimise to the bottom left of
the
screen. If it is a modal form this pretty much disables the application
unless the user realises this is what they have done.
I would imagine in most cases (and I agree there are exceptions) that a
user
wanting to mimimise a form wants to get the whole application out of the
way.
It seems to me that the default behaviour - or at least an easily accessibe
option - would be to specify the whole application to mimimise,
ie
Application.minimize
But this is not easy to do - I have had to resort to code like the example
below to get the whole application to mimimise. Am I missing something???
Because this below means adding code to every form that you want to have
minimise the whole application - which is very tedious
public
{ Public declarations }
procedure WMSysCommand
(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
....
procedure Tform2.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType = SC_MINIMIZE) then
Application.minimize
else
DefaultHandler(Msg);
end;
John
More information about the Delphi
mailing list