I have to change an old MFC-application, which uses dialogs derived from CMDIChildWnd. The style of the dialog is set to WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX. Resizing support is implemented via ON_WM_SIZE() and OnSize().
As expected the window does not have a maximize button in the title bar. When the window is minimized OnSize() is called after I request the dialog to restore its original size. Nonetheless I'm not able to resize the dialog.
If I add WS_MAXIMIZEBOX to the dialog's style, I of course get a maximize button in the toolbar, but it is disabled. After using the title bar's popup menu to resize the dialog once, everything works fine - I can change the size of the dialog.
What do I have to change to enable resizing f开发者_StackOverflow社区or these dialogs (without using the popup menu of course ;-)?
Add WS_SIZEBOX (or possibly WS_THICKFRAME) TO YOUR .RC file. Resizing is enabled!
精彩评论