void CViewerFrame::FullScreenShow(){ GetWindowPlacement(&m_OldWndPlacement); CRect WindowRect; GetWindowRect(&WindowRect); CRect ClientRect; RepositionBars(0,0xffff,AFX_IDW_PANE_FIRST,reposQuery,&ClientRect); ClientToScreen(&ClientRect); int nFullWidth=GetSystemMetrics(SM_CXSCREEN); int nFullHeight=GetSystemMetrics(SM_CYSCREEN); m_FullScreenRect.left=WindowRect.left-ClientRect.left-1; m_FullScreenRect.top=WindowRect.top-ClientRect.top-1; m_FullScreenRect.right=WindowRect.right-ClientRect.right+nFullWidth+2; m_FullScreenRect.bottom=WindowRect.bottom-ClientRect.bottom+nFullHeight+2; m_FullScreen=TRUE; WINDOWPLACEMENT wndpl; wndpl.length=sizeof(WINDOWPLACEMENT); wndpl.flags=0; wndpl.showCmd=SW_SHOWNORMAL; wndpl.rcNormalPosition=m_FullScreenRect; ShowWindow(SW_HIDE); SetWindowPlacement(&wndpl);}
关闭全屏显示的代码:
void CViewerFrame::EndFullScreen(){ m_FullScreen=FALSE; ShowWindow(SW_HIDE); SetWindowPlacement(&m_OldWndPlacement);}