From 7ec4bada3c739e67d5a4c49af39da703c16c66c1 Mon Sep 17 00:00:00 2001 From: Viktor Jannicke Date: Fri, 24 Jul 2026 14:16:08 +0200 Subject: [PATCH] Fix Windows WebView application icon fallback --- src/webui.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/webui.c b/src/webui.c index 28e9ee721..d5a6e829f 100644 --- a/src/webui.c +++ b/src/webui.c @@ -12804,8 +12804,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.cbClsExtra = 0; wc.cbWndExtra = 0; - wc.hIcon = LoadIcon(GetModuleHandle(NULL) ,MAKEINTRESOURCE(101)); // default user icon resouce : 101 - if(!wc.hIcon) wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); // if not existed, use system default icon + wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(101)); // default user icon resource: 101 + if (!wc.hIcon) wc.hIcon = LoadIcon(wc.hInstance, IDI_APPLICATION); // otherwise, use the executable's application icon + if (!wc.hIcon) wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); // if not present, use the system default icon if (!RegisterClassA(&wc) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) { _webui_wv_free(win->webView);