to turn on full-screen display code:
View source code copy to clipboard Print Code 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::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); }
to turn off full-screen display code:
View source code copy to clipboard print code void Cviewerframe::endfullscreen () {m_fullscreen=false; ShowWindow (Sw_hide); SetWindowPlacement (&m_oldwndplacement); }
void Cviewerframe::endfullscreen () {m_fullscreen=false; ShowWindow (Sw_hide); SetWindowPlacement (&m_oldwndplacement); }
NOTE: Reprint article should indicate source: Vcer.net article address: http://vcer.net/1076417661406.html