Skip to content

Commit 3b41a5e

Browse files
brianostmsbkudiess
authored andcommitted
CP Adjust apiset fallback for user32 dependencies in WebView2 (#7977)
commit 80a4bf4
1 parent 5ee4235 commit 3b41a5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dev/WebView2/WebView2.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ static constexpr wstring_view s_error_cwv2_not_present_closed{ L"Failed because
2929

3030
WebView2::WebView2()
3131
{
32-
if (auto user32module = GetModuleHandleW(L"user32.dll"))
32+
auto user32module = GetModuleHandleW(L"ext-ms-win-rtcore-webview-l1-1-0.dll");
33+
if (!user32module)
34+
{
35+
user32module = GetModuleHandleW(L"user32.dll");
36+
}
37+
38+
if (user32module)
3339
{
3440
m_fnClientToScreen = reinterpret_cast<decltype(m_fnClientToScreen)>(GetProcAddress(user32module, "ClientToScreen"));
3541
m_fnSendMessageW = reinterpret_cast<decltype(m_fnSendMessageW)>(GetProcAddress(user32module, "SendMessageW"));

0 commit comments

Comments
 (0)