You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(windows): show app icon in MessageDialog via MessageBoxIndirectW - #6250
MessageBoxW (used by v2 MessageDialog on Windows) takes no icon resource argument — it can only render the four stock icons, so the application icon never appears in the message box and the frame icon never inherits the owner window (#3684). MB_SYSTEMMODAL is orthogonal to icon selection (modality only).
Mirrors the merged v3 fix (#5576): show the message box via MessageBoxIndirectW + MB_USERICON, passing the module handle (GetModuleHandle) and the icon resource id as MAKEINTRESOURCE. Reads winc.AppIconID (mutable via SetAppIcon, defaults to 3) instead of a hardcoded value. Stock-icon bits are stripped (mixed MB_ICON* + MB_USERICON is undefined) while button config and MB_SYSTEMMODAL survive.
If the icon resource is missing (dev builds: go run / wails dev, no embedded .syso), MessageBoxIndirect fails outright (#4233) — falls back to the original MessageBoxW call so the message is still shown.
Custom Icon []byte rendering is unchanged/out of scope (needs TaskDialog; same limitation documented in v3).
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Unit: go test -count=1 -run '[Mm]essageDialog' -v ./internal/frontend/desktop/windows/... (7 existing + 6 new flag-conversion cases pass); full package suite ok; gofmt clean on committed blobs; go build ./internal/... ./pkg/runtime/... clean.
Manual UI verification (app icon in dialog body with embedded rsrc.syso; fallback dialog without it) needs a live Windows GUI session — not run here; flag conversion is the only non-trivial logic and is unit-tested.
Windows
macOS
Linux
Test Configuration
wails doctor: Windows 11 (Build 26200), Go 1.26.6, amd64, WebView2 154.0.4258.62, Node 24.19.0, npm 11.17.0.
Checklist:
(v2 only) I have updated website/src/pages/changelog.mdx with details of this PR
My code follows the general coding style of this project
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
Summary by CodeRabbit
Bug Fixes
Windows message dialogs now display the application icon. If it can’t be shown, the dialog falls back to a standard system icon.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Walkthrough
Windows MessageDialog now attempts to display the application icon through MessageBoxIndirectW. If that call returns an error, it falls back to the stock-icon message box. Tests cover the dialog flags, and the changelog records the fix.
Changes
Windows dialog icon
Layer / File(s)
Summary
Indirect message-box API v2/internal/frontend/desktop/windows/winc/w32/typedef.go, v2/internal/frontend/desktop/windows/winc/w32/user32.go
The w32 package adds MSGBOXPARAMS, binds MessageBoxIndirectW, and adds MessageBoxWithIcon to return the API result or syscall error.
Dialog icon and fallback v2/internal/frontend/desktop/windows/dialog.go, v2/internal/frontend/desktop/windows/dialog_test.go, website/src/pages/changelog.mdx
MessageDialog adds user-icon and system-modal flags, attempts to show the application icon, and falls back to MessageBox on error. Tests cover the flags. The changelog records the fix.
No confirmed issue blocks merging. The icon display and missing-resource fallback have not been checked in a live Windows GUI session.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. (1 skipped: 1…
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Linked Issues check
Issue [#3684] requires the Windows runtime.MessageDialog icon to match the application or parent-window icon. The PR changes the v2 Windows dialog path to call MessageBoxIndirectW with `MB_USERICO…
Out of Scope Changes check
The changes stay within issue [#3684]. The dialog update implements icon selection, the MSGBOXPARAMS and MessageBoxIndirectW bindings support that update, the tests verify flag conversion, and the…
Title check
The title clearly identifies the Windows MessageDialog fix and the use of MessageBoxIndirectW to show the application icon.
Description check
The description covers the issue, implementation, fallback behavior, testing, environment, scope, and checklist. It links issue #3684 and reports that manual Windows UI verification was not performed.
Full details: Docstring Coverage
Explanation
Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. (1 skipped: 1 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
I’m a rabbit with a dialog to show, The app’s own icon now joins the flow. If that first call cannot appear, A stock icon steps in, bright and clear. I thump my paws and hop away.
Comment @coderabbitai help to get the list of available commands.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MessageBoxW (used by v2 MessageDialog on Windows) takes no icon resource argument — it can only render the four stock icons, so the application icon never appears in the message box and the frame icon never inherits the owner window (#3684). MB_SYSTEMMODAL is orthogonal to icon selection (modality only).
Mirrors the merged v3 fix (#5576): show the message box via MessageBoxIndirectW + MB_USERICON, passing the module handle (GetModuleHandle) and the icon resource id as MAKEINTRESOURCE. Reads winc.AppIconID (mutable via SetAppIcon, defaults to 3) instead of a hardcoded value. Stock-icon bits are stripped (mixed MB_ICON* + MB_USERICON is undefined) while button config and MB_SYSTEMMODAL survive.
If the icon resource is missing (dev builds: go run / wails dev, no embedded .syso), MessageBoxIndirect fails outright (#4233) — falls back to the original MessageBoxW call so the message is still shown.
Custom Icon []byte rendering is unchanged/out of scope (needs TaskDialog; same limitation documented in v3).
Fixes #3684
Type of change
How Has This Been Tested?
Unit: go test -count=1 -run '[Mm]essageDialog' -v ./internal/frontend/desktop/windows/... (7 existing + 6 new flag-conversion cases pass); full package suite ok; gofmt clean on committed blobs; go build ./internal/... ./pkg/runtime/... clean.
Manual UI verification (app icon in dialog body with embedded rsrc.syso; fallback dialog without it) needs a live Windows GUI session — not run here; flag conversion is the only non-trivial logic and is unit-tested.
Test Configuration
wails doctor: Windows 11 (Build 26200), Go 1.26.6, amd64, WebView2 154.0.4258.62, Node 24.19.0, npm 11.17.0.
Checklist:
Summary by CodeRabbit