Discussion:
Detect Child Window minimize, maximize, restore, etc...
(too old to reply)
jmvalente
2005-03-10 11:03:15 UTC
Permalink
hi,
it's possible to a parent( CMDIFrameWnd ) window determine that a child
window(CMDIChildWnd) have become minimized?

thanks for all the help

valente
Nishant Sivakumar
2005-03-10 11:22:44 UTC
Permalink
You need to handle WM_SYSCOMMAND in the CMDIChildWnd derived class.
Something like :-

void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
if(nID == SC_MINIMIZE)
{
GetParentFrame()->PostMessage(...);//notify parent frame
}

CMDIChildWnd::OnSysCommand(nID, lParam);
}
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
Post by jmvalente
hi,
it's possible to a parent( CMDIFrameWnd ) window determine that a child
window(CMDIChildWnd) have become minimized?
thanks for all the help
valente
CheckAbdoul
2005-03-10 14:37:27 UTC
Permalink
I believe it should be

if ( (nID & 0xFFF0) == SC_MINIMIZE )
--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------
Post by Nishant Sivakumar
You need to handle WM_SYSCOMMAND in the CMDIChildWnd derived class.
Something like :-
void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
if(nID == SC_MINIMIZE)
{
GetParentFrame()->PostMessage(...);//notify parent frame
}
CMDIChildWnd::OnSysCommand(nID, lParam);
}
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
Post by jmvalente
hi,
it's possible to a parent( CMDIFrameWnd ) window determine that a child
window(CMDIChildWnd) have become minimized?
thanks for all the help
valente
Nishant Sivakumar
2005-03-11 04:10:58 UTC
Permalink
Yes - sorry about that.
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
Post by CheckAbdoul
I believe it should be
if ( (nID & 0xFFF0) == SC_MINIMIZE )
--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------
Post by Nishant Sivakumar
You need to handle WM_SYSCOMMAND in the CMDIChildWnd derived class.
Something like :-
void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
if(nID == SC_MINIMIZE)
{
GetParentFrame()->PostMessage(...);//notify parent frame
}
CMDIChildWnd::OnSysCommand(nID, lParam);
}
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
Post by jmvalente
hi,
it's possible to a parent( CMDIFrameWnd ) window determine that a child
window(CMDIChildWnd) have become minimized?
thanks for all the help
valente
Ajay Kalra
2005-03-10 19:23:18 UTC
Permalink
MDIChild windows are actually children of MDIClient area (the dark grey
area on MDIFrameWnd). This window manages maximize/restore of various
mdi child windows by sending WM_MDIMAXIMIZE, WM_MDIRESTORE etc.

What you can do is to subclass MDIClient area and when this message is
received, call mainframe etc to inform it.

I cant find the notification for minimize on the MDIClient area. There
has to be some notification as this window issues the minimize request
to the child.

---------
Ajay Kalra
***@yahoo.com
jmvalente
2005-03-11 11:10:55 UTC
Permalink
That's what i'm doing,
i subclass the MDIClient, but i can't find anya notification regarding
the children's minimize,maximize events :(

to overcome my problem i'm intercepting MDIClient WM_PAINT message and
then do my processing,
but i think that is not the "right" thing to do.


i like to thank you all, for your colaboration

valente
Nishant Sivakumar
2005-03-14 09:06:32 UTC
Permalink
There are no distinct messages for minimize, maximize etc

You gotta handle WM_SYSCOMMAND as mentioned in an earlier post in this
thread.
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
Post by jmvalente
That's what i'm doing,
i subclass the MDIClient, but i can't find anya notification regarding
the children's minimize,maximize events :(
to overcome my problem i'm intercepting MDIClient WM_PAINT message and
then do my processing,
but i think that is not the "right" thing to do.
i like to thank you all, for your colaboration
valente
Ajay Kalra
2005-03-14 14:16:48 UTC
Permalink
I just spy on a basic MDI app and it behaves as Nishant mentioned. You
will need to handle OnSysCommand on your childframe to get
minimize/maximize messages etc. MDIClient window indeed does not appear
to receive any of the expected WM_MDI* messages when a child frame is
minmized/maximized etc.

--------
Ajay Kalra
***@yahoo.com

Loading...