Programming/MFC-C++
화면 최대화 <-> 원래 화면
빠릿베짱이
2013. 5. 21. 16:31
반응형
/////// 전역변수 /////// int _style; CRect _originWindow; //////////////////////// void CEx2Dlg::OnBnClickedButton1() // 전체화면 { int windowWidth = GetSystemMetrics(SM_CXSCREEN); int windowHeight = GetSystemMetrics(SM_CYSCREEN); _style = ::GetWindowLong(this->m_hWnd, GWL_STYLE); ::GetWindowRect(this->m_hWnd, &_originWindow); ::SetWindowLong(this->m_hWnd, GWL_STYLE, NULL); SetWindowPos(&wndTopMost, 0, 0, windowWidth, windowHeight, NULL); ShowWindow( SW_MAXIMIZE ); } void CEx2Dlg::OnBnClickedButton2() // 원래대로 { ::SetWindowLong(this->m_hWnd, GWL_STYLE, _style); SetWindowPos(GetParent(), _originWindow.left, _originWindow.top, _originWindow.right - _originWindow.left, _originWindow.bottom - _originWindow.top, NULL); }
반응형