Comment passer un plein écran ? Le mode sans barre de titre, ni menu... Connu aussi sous le nom de "Full Full Screen". Déclarer WINDOWPLACEMENT m_WindowPlacement ; dans CMainFrame et reproduire le code ci-dessous. void CMainFrame::OnViewFullScreen() { // read system metrics int cyCaption = ::GetSystemMetrics ( SM_CYCAPTION ) ; int cyMenu = ::GetSystemMetrics ( SM_CYMENU ) ; int cxFrame = ::GetSystemMetrics ( SM_CXFRAME ) ; int cyFrame = ::GetSystemMetrics ( SM_CYFRAME ) ; int cxScreen = ::GetSystemMetrics ( SM_CXSCREEN ) ; int cyScreen = ::GetSystemMetrics ( SM_CYSCREEN ) ; WINDOWPLACEMENT NewWindowPlacement ; if ( ! m_bFullScreen ) { GetWindowPlacement ( & m_WindowPlacement ) ; NewWindowPlacement = m_WindowPlacement ; NewWindowPlacement.showCmd = SW_SHOWNORMAL ; // run the app full screen ShowWindow ( SW_SHOWMAXIMIZED ) ; // now run the app full full screen NewWindowPlacement.rcNormalPosition = CRect ( -cxFrame, - ( cyFrame + cyCaption + cyMenu ) , cxScreen + 2 * cxFrame , cyScreen + 2 * cyFrame + cyCaption + cyMenu ) ; } else { NewWindowPlacement = m_WindowPlacement ; } ; m_bFullScreen = ! m_bFullScreen ; SetWindowPlacement ( & NewWindowPlacement ) ; } void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // read system metrics int cyCaption = ::GetSystemMetrics ( SM_CYCAPTION ) ; int cyMenu = ::GetSystemMetrics ( SM_CYMENU ) ; int cxFrame = ::GetSystemMetrics ( SM_CXFRAME ) ; int cyFrame = ::GetSystemMetrics ( SM_CYFRAME ) ; int cxScreen = ::GetSystemMetrics ( SM_CXSCREEN ) ; int cyScreen = ::GetSystemMetrics ( SM_CYSCREEN ) ; CFrameWnd::OnGetMinMaxInfo ( lpMMI ) ; if ( m_bFullScreen ) { lpMMI->ptMaxPosition.x = - cxFrame ; lpMMI->ptMaxSize.x lpMMI->ptMaxTrackSize.x cxScreen + 2 * cxFrame ; lpMMI->ptMaxPosition.y = - ( cyFrame + cyCaption + cyMenu ) ; lpMMI->ptMaxSize.y lpMMI->ptMaxTrackSize.y cyScreen + 2 * cyFrame + cyCaption + cyMenu ; } ; }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question