MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Samples / EnterFullScreen

Method EnterFullScreen

SampleApps/WebView2APISample/AppWindow.cpp:2905–2922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2903}
2904
2905void AppWindow::EnterFullScreen()
2906{
2907 DWORD style = GetWindowLong(m_mainWindow, GWL_STYLE);
2908 MONITORINFO monitor_info = {sizeof(monitor_info)};
2909 m_hMenu = ::GetMenu(m_mainWindow);
2910 ::SetMenu(m_mainWindow, nullptr);
2911 if (GetWindowRect(m_mainWindow, &m_previousWindowRect) &&
2912 GetMonitorInfo(
2913 MonitorFromWindow(m_mainWindow, MONITOR_DEFAULTTOPRIMARY), &monitor_info))
2914 {
2915 SetWindowLong(m_mainWindow, GWL_STYLE, style & ~WS_OVERLAPPEDWINDOW);
2916 SetWindowPos(
2917 m_mainWindow, HWND_TOP, monitor_info.rcMonitor.left, monitor_info.rcMonitor.top,
2918 monitor_info.rcMonitor.right - monitor_info.rcMonitor.left,
2919 monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top,
2920 SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
2921 }
2922}
2923
2924void AppWindow::ExitFullScreen()
2925{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected