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
Setting NotifyIcon.TooltipText to non-ASCII text renders as ? characters in the tray tooltip #1705
Setting NotifyIcon.TooltipText to a string containing non-ASCII characters results in those characters being replaced with ? in the tray tooltip on systems whose system ANSI codepage cannot represent them. The same defect affects szInfo (balloon body) and szInfoTitle (balloon title).
Reproduction
Tested on en-US Windows 11 24H2 (build 26200), WPF-UI 4.2.1, .NET 10:
C# defaults StructLayoutAttribute.CharSet to Ansi. UnmanagedType.ByValTStr follows the enclosing struct's charset, so szTip/szInfo/szInfoTitle are marshaled via Encoding.Default.GetBytes(...), which substitutes ? for code points unrepresentable in the active ANSI codepage. The matching import:
ByValTStr's SizeConst slots are interpreted per the new charset (i.e. 128 wide chars instead of 128 ANSI bytes for szTip), so the struct's binary size grows accordingly. cbSize = Marshal.SizeOf(typeof(NOTIFYICONDATA)) recomputes correctly and routes the call through Shell_NotifyIconW. No call-site changes required.
Workaround for consumers
Subclass NotifyIcon, override OnPropertyChanged, and after base re-send the tooltip via your own Unicode-charset NOTIFYICONDATA mirror + Shell_NotifyIconW(NIM.MODIFY, NIF.TIP). Reflection on the existing internal ShellIconData recovers hWnd and uID. Re-apply on both TooltipTextProperty and IconProperty changes — TrayManager.ModifyIcon re-sends the same ANSI szTip from the cached struct, which would otherwise overwrite the Unicode fix on every icon update.
Environment
WPF-UI: 4.2.1
Target framework: net10.0-windows10.0.26100.0 (also reproduces on net8.0-windows)
Activity
chucker commentedon May 2, 2026
I seem to have a fix.
However, it looks like the tray library should be arch-specific, and I need to figure out the tooling for that.