Many players have shortcut control windows that are displayed in full screen mode. Adding full-screen functionality to your application does not require a lot of code, such as adding full-screen functionality to a dialog-based application that only requires the following small amount of code to work.
Many players have shortcut control windows that are displayed in full screen mode. Adding full-screen functionality to your application does not require a lot of code, such as adding full-screen functionality to a dialog-based application that only requires the following small amount of code to work.
The code is as follows:
void Cfullscreendlg::fullscreenview (void)
{
RECT Rectdesktop;
Windowplacement wpnew;
if (! IsFullScreen ())
{
We ' ll need these to restore the original state.
GetWindowPlacement (&m_wpprev);
Adjust RECT to new size of window
:: GetWindowRect (:: GetDesktopWindow (), &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
{
Revert to the original window state when exiting 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 currently in full-screen state
return m_bfullscreen;
}650) this.width=650; "src=" Http://images.enet.com.cn/end.gif "height=" one "width=" one "border=" 0 "alt=" end.gif "/>
The code is complete.
How MFC implements full-screen functionality