Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an MFC MDIFrame / View architecture. When the child frame/view is resized I want to resize some of the displayed controls.

So, in my CMDIChildWnd, I handle OnExitSizeMove, because I don't want to recalculate on every OnSize message. This works fine, but not when the child is maxmised or restored.

I thought it would be easy to check in my view's OnSize event for nType == SIZE_MAXIMIZED, but for some reason it is always equal to SIZE_MAXIMIZED.

How can I detect my MDIChild's maximise / restore events?

What I have tried:

I tried catching every combination of size, window position and resizing messages I could think of. Both in my view and my child frame, using the function overrides and even through PreTranslateMessage, I just can't usefully detect this simple event.

It's driving me mad.
Posted
Updated 22-Jun-21 18:36pm
v2

1 solution

I found it! Had to monitor CChildFrame::OnSysCommand for SC_RESTORE and SC_MAXIMIZE
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900