integrate an icon in a compiled .exe

Just starting out? Need help? Post your questions and find answers here.
daft
User
User
Posts: 25
Joined: Fri Oct 29, 2010 10:32 am

integrate an icon in a compiled .exe

Post by daft »

Is there an easy way to integrate an icon or two into a compiled exe file? I'd like to switch my tray icons and don't want to have separate icon files in the program directory.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: integrate an icon in a compiled .exe

Post by ts-soft »

IncludeBinary, CatchImage
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.
Image
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: integrate an icon in a compiled .exe

Post by TomS »

Code: Select all

Enumeration
    #TrayIcon_0
    #TrayIcon_1
EndEnumeration

CatchImage(#TrayIcon_0, ?Systray_0)
CatchImage(#TrayIcon_1, ?Systray_1)

;AddSysTrayIcon(#SysTrayIcon, WindowID,#TrayIcon_0)

End

DataSection
    Systray_0: IncludeBinary "systray0.ico"
    Systray_1: IncludeBinary "systray1.ico"
  EndDataSection
Post Reply