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

Method AppWindow

SampleApps/WebView2SampleWinComp/AppWindow.cpp:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static constexpr WCHAR c_samplePath[] = L"WebView2SamplePage.html";
15
16AppWindow::AppWindow() : m_winComp(std::make_unique<CompositionHost>())
17{
18 WCHAR szTitle[MAX_LOADSTRING]; // The title bar text
19 CHECK_FAILURE(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED));
20 LoadStringW(hInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
21
22 // Perform application initialization:
23 m_mainWindow = CreateWindowW(
24 GetWindowClass(), szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
25 nullptr, nullptr, hInst, nullptr);
26 SetWindowLongPtr(m_mainWindow, GWLP_USERDATA, (LONG_PTR)this);
27 ShowWindow(m_mainWindow, nCmdShow);
28 UpdateWindow(m_mainWindow);
29
30 m_sampleUri = GetLocalUri(c_samplePath);
31 InitializeWebView();
32}
33
34// Register the Win32 window class for the app window.
35PCWSTR AppWindow::GetWindowClass()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected