I'm sure this has been asked and answered before, but due to vague keywords I'm having trouble searching for it.
If I compile an exe with a main icon (to appear in window's titlebar, as its explorer icon, etc) how can I extract this at runtime to also use as a tray icon?
It seems redundant to have an internal copy of the icon compiled inside, plus an external file just to be loaded for the system tray.
Suggestions?
Extract a program's own icon?
Code: Select all
Icon = LoadIcon_(GetModuleHandle_(0), 1)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Thanks - works well for me in combination with DrawIcon_().ts-soft wrote:Code: Select all
Icon = LoadIcon_(GetModuleHandle_(0), 1)
Windows 7 & PureBasic 4.4