最大化后没有恢复按钮 window

No restore button in maximised window

当我最大化我的一个 mdi 客户端时 windows。然后我坚持使用它最大化,我需要能够恢复它以查看其他 windows.

WNDCLASSEX wc;

wc.cbSize        = sizeof(WNDCLASSEX);
wc.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wc.lpfnWndProc   = CWindowHandler::MsgRouter;
wc.cbClsExtra    = 0;
wc.cbWndExtra    = 0;
wc.hInstance     = hInstance;
wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName  = NULL;
wc.lpszClassName = childClassName;
wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

hChild = CreateMDIWindow(childClassName, "Segments", WS_OVERLAPPEDWINDOW, m_winRect.left, m_winRect.top, m_winRect.right - m_winRect.left, m_winRect.bottom - m_winRect.top, CWindowHandler::GetInstance()->GetMDIClient(), m_hInstance, (LPARAM)this);

我相信您必须添加样式 MDIS_ALLCHILDSTYLES 才能获得所需的 window 样式。来自 MSDN...

The style of the MDI child window. If the MDI client window is created with the MDIS_ALLCHILDSTYLES window style, this parameter can be any combination of the window styles listed in the Window Styles page. Otherwise, this parameter is limited to one or more of the following values.

我通过调用 return DefMDIChildProc(m_Hwnd, msg, wParam, lParam) 解决了这个问题;在 WM_SIZE 的情况下:child window 的 wndprocs。天知道为什么但它奏效了。