[SOLVED] How to embed an ico to exe

Just starting out? Need help? Post your questions and find answers here.
avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

[SOLVED] How to embed an ico to exe

Post by avatar »

I am reading the example Systray.pb.

The ico and bmp files are located at the sub-directory of "Data".

When I compile the example to be an executable, how can I also embed the resource files (ico and bmp) into the exe?
Last edited by avatar on Sat Apr 17, 2010 3:24 am, edited 3 times in total.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: How to embed an ico to exe

Post by ts-soft »

The simpelst way is with IncludeBinary
and CatchImage
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: How to embed an ico to exe

Post by Trond »

Code: Select all


; Include the icons in the exe
DataSection
  MyIconLabel:
  IncludeBinary "icon filename.ico"

  MyOtherIconLabel:
  IncludeBinary "other icon filename.ico"
EndDataSection

; Use CatchImage() instead of LoadImage()
CatchImage(0, ?MyIconLabel)
CatchImage(1, ?MyOtherIconLabel)
; I don't remember if this is the exact syntax, but lookup CatchImage() in the manual.

avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

Re: How to embed an ico to exe

Post by avatar »

Thanks a lot.
Post Reply