15,979
社区成员
发帖
与我相关
我的任务
分享
void CXXXDlg::SetFullScreen()
{
int frameWidth = GetSystemMetrics(SM_CXFRAME);
int frameHeight = GetSystemMetrics(SM_CYFRAME);
int captionHeight = GetSystemMetrics(SM_CYCAPTION);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
CRect rect;
GetClientRect(&rect);
rect.left = rect.left - frameWidth;
rect.top = rect.top - frameHeight - captionHeight ;
rect.bottom = rect.top + screenHeight + 2 * frameHeight + captionHeight;
rect.right = rect.left + screenWidth + 2 * frameWidth;
ShowWindow(SW_HIDE);
SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW);
}
WINDOWPLACEMENT newment;
newment.length = sizeof(WINDOWPLACEMENT);
newment.flags = WPF_RESTORETOMAXIMIZED;
newment.showCmd = SW_SHOWMAXIMIZED;
newment.ptMaxPosition.x = 0;
newment.ptMaxPosition.y = 0;
newment.ptMinPosition.x = 0;
newment.ptMinPosition.y = 0;
newment.rcNormalPosition.left = -0;
newment.rcNormalPosition.top = -0;
newment.rcNormalPosition.bottom = m_rectWnd.bottom;
newment.rcNormalPosition.right = m_rectWnd.right;
SetWindowPlacement(&newment);
CRect rect;
::GetClientRect(::GetDesktopWindow(), &rect);
SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW);