void CWindow::ToggleFullscreen() { if (m_graphics == NULL || !m_active) return; m_graphics->m_windowed = !m_graphics->m_windowed; if(m_graphics->m_windowed) SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW); else { ZeroMemory(&m_wp, sizeof(WINDOWPLACEMENT)); m_wp.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(m_hWnd, &m_wp); SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_EX_TOPMOST); ShowWindow(m_hWnd, SW_HIDE); } OnLostDevice(); m_graphics->Reset(); OnResetDevice(); if(m_graphics->m_windowed) SetWindowPlacement(m_hWnd, &m_wp); if(!IsWindowVisible(m_hWnd)) ShowWindow(m_hWnd, SW_SHOW); }