Bool fullscreenviewctrl (hwnd m_hwnd, // The Window handle bool bfullscreen to be full screen) // ture to full screen false to exit full screen {static hwnd pparentwndsave = NULL; // parent window handle static DWORD dwwindowstylesave = 0; // window style static rect rcwndrectsave = {0, 0, 0}; // window Position static bool benterfullview = false; // enter full screen? _ Assert (iswindow (m_hwnd); If (bfullscreen) {If (! Benterfullview) // non-full screen mode {dwwindowstylesave = getwindowlong (m_hwnd, gwl_style); // Save the window style getwindowrect (m_hwnd, & rcwndrectsave ); // Save the window position pparentwndsave = setparent (m_hwnd, null); // Save the parent window handle/set the parent window setwindowlong (m_hwnd, gwl_style, dwwindowstylesave &(~ Ws_child) | summary); // make the window have a popup style setwindowpos (m_hwnd, hwnd_top, 0, 0, getsystemmetrics (sm_cxscreen), getsystemmetrics (sm_cyscreen), callback | scheme | swp_framechanged ); // modify the window to set full screen benterfullview = true; // enter full screen mode} else {If (benterfullview) // It is full screen mode {setwindowlong (m_hwnd, gwl_style, windowstylesave ); // restore the window style setparent (m_hwnd, pparentwndsave); // restore the parent window handle point ptlt = {rcwndrectsa Ve. left, rcwndrectsave. top}; screentoclient (m_hwnd, & ptlt); movewindow (m_hwnd, ptlt. x, ptlt. y, rcwndrectsave. right-rcWndRectSave.left, rcwndrectsave. bottom-rcWndRectSave.top, true); // Restore original position benterfullview = false; // exit full screen mode} return benterfullview; // return whether it is full screen ?}