Many players have shortcut key control windows displayed in full screen mode. Adding the full screen function to an application does not require a lot of code. For example, adding the full screen function to a dialog box-based application requires only a small amount of code to work.
Void CFullScreenDlg: FullScreenView (void)
{
RECT rectDesktop;
WINDOWPLACEMENT wpNew;
If (! IsFullScreen ())
{
// Well need these to restore the original state.
GetWindowPlacement (& m_wpPrev );
// Adjust RECT to new size of window
: GetWindowRect (: getwindowtopwindow (), rectDesktop );
: AdjustWindowRectEx (rectDesktop, GetStyle (), FALSE, GetExStyle ());
// Remember this for OnGetMinMaxInfo ()
M_rcFullScreenRect = rectDesktop;
WpNew = m_wpPrev;
WpNew. showCmd = SW_SHOWNORMAL;
WpNew. rcNormalPosition = rectDesktop;
M_bFullScreen = true;
}
Else
{
// Restore to the original window status when you exit the full screen
M_bFullScreen = false;
WpNew = m_wpPrev;
}
SetWindowPlacement (& wpNew );
}
Void CFullScreenDlg: OnGetMinMaxInfo (MINMAXINFO * lpMMI)
{
// TODO: Add your message handler code here and/or call default
If (IsFullScreen ())
{
LpMMI-> ptMaxSize. y = m_rcFullScreenRect.Height ();
LpMMI-> ptMaxTrackSize. y = lpMMI-> ptMaxSize. y;
LpMMI-> ptMaxSize. x = m_rcFullScreenRect.Width ();
LpMMI-> ptMaxTrackSize. x = lpMMI-> ptMaxSize. x;
}
CDialog: OnGetMinMaxInfo (lpMMI );
}
Bool CFullScreenDlg: IsFullScreen (void)
{
// Record whether the window is in full screen status
Return m_bFullScreen;
}