Skip to content

Fix Windows WebView icon fallback to use executable icon#709

Merged
AlbertShown merged 1 commit into
webui-dev:mainfrom
ViktorJannicke:fix-windows-application-icon
Jul 24, 2026
Merged

Fix Windows WebView icon fallback to use executable icon#709
AlbertShown merged 1 commit into
webui-dev:mainfrom
ViktorJannicke:fix-windows-application-icon

Conversation

@ViktorJannicke

Copy link
Copy Markdown

Fixes #708

Summary

Improve the Windows WebView window-icon fallback sequence:

  1. Preserve the existing custom icon resource ID 101.
  2. Fall back to the executable’s IDI_APPLICATION resource.
  3. Fall back to the generic Windows application icon only when neither executable resource exists.

Motivation

WebUI currently loads resource 101 and then immediately uses the generic system icon when that resource is absent.

Windows applications commonly store their executable application icon under IDI_APPLICATION (resource 32512). As a result, an executable can be correctly branded in Explorer while its WebUI window, taskbar button, caption, and Alt+Tab entry display the generic icon.

Using wc.hInstance with IDI_APPLICATION loads the resource from the executable. The existing LoadIcon(NULL, IDI_APPLICATION) call remains the final system fallback.

Compatibility

  • Existing applications using resource 101 retain precedence.
  • Applications using IDI_APPLICATION now receive their embedded icon.
  • Applications without either resource continue to receive the generic system icon.
  • No public API or ABI changes are introduced.
  • The change only affects the Windows embedded WebView implementation.

Testing

Built successfully on Windows with MSVC as:

  • A shared WebUI DLL
  • A static WebUI library with WEBUI_WEBVIEW_STATIC

@AlbertShown
AlbertShown merged commit 46059a7 into webui-dev:main Jul 24, 2026
5 of 23 checks passed
@AlbertShown

Copy link
Copy Markdown
Member

Thank you @ViktorJannicke, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows WebView ignores executable application icon unless it uses resource ID 101

2 participants