One, mainframe add a record whether the full-screen state of the variable bool M_bfullscreen.
Second, the toolbar to add a button for full-screen operation, the response event function written in mainframe.
Third, in the response function, add the following code:
void Cmainframe::onfullscreen ()
{
if (!m_bfullscreen)
{
This->modifystyle (ws_thickframe| Ws_caption,null);
This->movewindow (CRect (0,0,::getsystemmetrics (Sm_cxscreen),:: GetSystemMetrics (Sm_cyscreen)), TRUE);
This->showwindow (sw_showmaximized);
FindWindow ("Shell_traywnd", NULL)->showwindow (sw_hide);
}
Else
{
This->modifystyle (null,ws_thickframe| Ws_caption);
FindWindow ("Shell_traywnd", NULL)->showwindow (sw_show);
This->showwindow (Sw_show);
}
This->updatewindow ();
M_bfullscreen =!m_bfullscreen;
}
When the full screen is displayed, you need to remove the system's taskbar, the program's form surgery, and when you exit the full screen, restore these.
VC + + Learning Note five sdi| Full-screen display of MDI