怎么在窗口最大化时禁止拖动窗口边框来改变窗口大小
如何在窗口最大化时禁止拖动窗口边框来改变窗口大小
SDI的MainFrame,如何在窗口最大化时禁止拖动窗口边框来改变窗口大小
------解决方案--------------------
LONG style = ::GetWindowLong(this-> m_hWnd,GWL_STYLE);
style &= ~(WS_DLGFRAME | WS_THICKFRAME);
SetWindowLong(this-> m_hWnd,GWL_STYLE, style);
this-> ShowWindow(SW_SHOWMAXIMIZED);
CRect rect;
this-> GetWindowRect(&rect);
::SetWindowPos(this-> m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
------解决方案--------------------
style |= WS_DLGFRAME | WS_THICKFRAME;
SetWindowLong(this-> m_hWnd, GWL_STYLE, style);
this-> ShowWindow(SW_NORMAL);
SDI的MainFrame,如何在窗口最大化时禁止拖动窗口边框来改变窗口大小
------解决方案--------------------
LONG style = ::GetWindowLong(this-> m_hWnd,GWL_STYLE);
style &= ~(WS_DLGFRAME | WS_THICKFRAME);
SetWindowLong(this-> m_hWnd,GWL_STYLE, style);
this-> ShowWindow(SW_SHOWMAXIMIZED);
CRect rect;
this-> GetWindowRect(&rect);
::SetWindowPos(this-> m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
------解决方案--------------------
style |= WS_DLGFRAME | WS_THICKFRAME;
SetWindowLong(this-> m_hWnd, GWL_STYLE, style);
this-> ShowWindow(SW_NORMAL);