My application is similar to the TabPages sample in that when I press file->new I get a new tabbed dialog. The bottom of this child dialog is bordered by a dockable window. Unlike the sample, my windows are set up to start out maximized. When I create a child dialog in 2.84, the bottom of my child window gets cut off, which never used to happen. It looks as if the height of the tab on the dialog isn’t taken into account when sizing the window. In other words, the height of the tab is appoximately the same as the amount of the bottom of the dialog that’s chopped off. <vent>Worked great in 2.83, now broken. I have been using prof uis for a long time and I have to say 2.84 sure has a ton of regressions. I am very frustrated as I’ve been spending HOURS trying to squash these bugs and I’m wondering how many others I haven’t found yet. </vent>
To fix this particular, I had to edit the epically long CExtMenuControlBar::OnHookWndMsg. In it, there is a handler for WM_MDIACTIVATE that no longer works. By comparing the code from 2.83 to 2.84, you can see that the handler is completely different.
2.83 pseudocode:
SetRedraw(false)
CExtHookSink::OnHookWndMsgDefault()
SetRedraw(true)
::RedrawWindow()
now in 2.84 (pseudocode)... (notice it’s completely different that 2.83):
CExtHookSink::OnHookWndMsgDefault()
SetWindowPos()
::PostMessage( hWndMdiClient, WM_SIZE, SIZE_RESTORED) <- Cause the window to be resized incorrectly. Commenting this out makes it work
Can you explain why the change was made? There must have been some reason for it although I can’t see what the benefit might have been.
Here is the actual code I changed to make my child windows not be cut off anymore:
if( hWndOld != NULL && bOldWasMaximized )
{
::SetWindowPos(
hWndNew, NULL, 0, 0, 0, 0,
SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE
|SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_FRAMECHANGED
);
//If you comment out these 3 lines, all is well. Keeping them in causes the bottom of the child windows to be cut off:
// CRect rcClient;
// ::GetClientRect( hWndMdiClient, &rcClient );
// ::PostMessage( hWndMdiClient, WM_SIZE, SIZE_RESTORED, MAKELPARAM( rcClient.Width(), rcClient.Height() ) );
}
Can you please explain why your change was made? I really don’t want to be off the upgrade path but I don’t want to have to make this change every time you come out with a new version. Any reason you guys can’t revet back to the 2.83 implementation of this part of the code?