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

Method ResizeEverything

SampleApps/WebView2APISample/AppWindow.cpp:2589–2606  ·  view source on GitHub ↗

Updates the sizing and positioning of everything in the window.

Source from the content-addressed store, hash-verified

2587
2588// Updates the sizing and positioning of everything in the window.
2589void AppWindow::ResizeEverything()
2590{
2591 RECT availableBounds = {0};
2592 GetClientRect(m_mainWindow, &availableBounds);
2593
2594 if (!m_containsFullscreenElement
2595 && !m_webviewOption.useWco
2596 )
2597 {
2598 availableBounds = m_toolbar.Resize(availableBounds);
2599 }
2600
2601 if (auto view = GetComponent<ViewComponent>())
2602 {
2603 view->SetBounds(availableBounds);
2604 }
2605 m_appBackgroundImageRect = availableBounds;
2606}
2607
2608//! [Close]
2609// Close the WebView and deinitialize related state. This doesn't close the app window.

Callers

nothing calls this directly

Calls 2

ResizeMethod · 0.80
SetBoundsMethod · 0.45

Tested by

no test coverage detected