Anyway, had a different user report the same bug today:

Same bug as the one in my other report. The result of "AddSysTrayImage()" is sometimes 0, but usually non-zero. Not using a VM this time. Using Win 11 Pro now. I can't understand what makes it 0 sometimes.
Here's the actual code in my app (pretty much the same as the original report), with parts left out that aren't relevant.
Code: Select all
#trayicon_app = 0
app = OpenWindow(#win_main, ...]
systrayimage = ImageID(CatchImage(#PB_Any,?Img_App_16_Standard))
[...]
systrayicon = AddSysTrayIcon(#trayicon_app, app, systrayimage)
If systrayicon = 0 ; <- What makes this be 0 sometimes?
StartFailure("Couldn't create new systray icon.")
Else
SetSysTrayTip()
EndIf
[...]
DataSection
Img_App_16_Standard: : IncludeBinary "[Assets]\App_16_Standard.ico"
EndDataSection
