This should work due to message inheritance. I think I have got this correct - or at least this is my understanding ...
The message should be sent to the child window first - ie your form. If it is not then handled, by the child window, the message is then passed to the child windows parent until the message is handled. If it not handled, then windows will do the default action defined for the message. Myles. -----Original Message----- From: Trevor Jones [mailto:[EMAIL PROTECTED] Sent: Wednesday, 2 June 2004 17:18 To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Detecting Maximize/Restore of a parent Thanks for that, but what I need to know is when the PARENT of my form is maximized or not, and when that state changes ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 02, 2004 4:53 PM Subject: RE: [DUG] Detecting Maximize/Restore of a parent > You could try something like: > > protected > procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND; > > [...] > > procedure TForm1.WMSysCommand(var Msg: TWMSysCommand); > begin > inherited; > if ((Msg.CmdType and $FFF0) = SC_MAXIMIZE) or > ((Msg.CmdType and $FFF0) = SC_RESTORE) then > // do stuff here > end; > > This worked for me when I needed to know if the form was maximized or > restored (in my case). > > Hope it helps, > > JED > > -----Original Message----- > From: Trevor Jones [mailto:[EMAIL PROTECTED] > Sent: 2 June 2004 2:33 PM > To: NZ Borland Developers Group - Delphi List > Subject: [DUG] Detecting Maximize/Restore of a parent > > > I have an app which is basically a wrapper and container for forms. > > These forms are parented by an area on the main form. > > Each of the forms has the ability to save information about control position > and size, and can do so for when the app is maximized, and when it isn't. > > If you use forms with lots of splitters or dynamically controlled control > sizes which are also persistent, you will know what I mean. > > So, if the main form is 800 by 600, one set of alignments is used. When > the app is maximized (which on my machine means 1280 by 1024), another set > of alignments come into force. > > I have all of the code to deal with the 2 situations, but am a little bit > stuck in how to find out when the maximized state of the parent (or parent's > parent) has changed. Currently I am using WM_SIZE, and walking the parent > list to find out whether or not the app's maximized state has changed, but > this seems ugly. Any suggestions? > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
