I haven't been here for a while, just not doing a lot of programming these days, but tonight I've run into this problem under PureBasic 5.70 LTS (Windows - x64): trying to load an icon (.ico) and use it with AddSysTrayIcon always fails for me, with "[ERROR] AddSysTrayIcon(): The specified 'ImageID' is not valid."
Am I doing something stupid here? I was trying to use CatchImage on an included binary, then LoadImage, and finally CreateImage -- all show a valid IsImage result, but fail with this message.
As far as I can tell this minimal example (please run in Debug mode) is doing the same as the SysTray.pb docs example...
Code: Select all
; RUN IN DEBUG MODE!
icon = CreateImage (#PB_Any, 32, 32)
; Non-zero!
Debug IsImage (icon)
window = OpenWindow (#PB_Any, 0, 0, 100, 100, "")
systray = AddSysTrayIcon (#PB_Any, WindowID (window), icon)
; [ERROR] AddSysTrayIcon(): The specified 'ImageID' is not valid.
End