Page 1 of 1

[SOLVED] How to embed an ico to exe

Posted: Fri Apr 16, 2010 11:53 am
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?

Re: How to embed an ico to exe

Posted: Fri Apr 16, 2010 11:59 am
by ts-soft
The simpelst way is with IncludeBinary
and CatchImage

Re: How to embed an ico to exe

Posted: Fri Apr 16, 2010 12:00 pm
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.


Re: How to embed an ico to exe

Posted: Fri Apr 16, 2010 12:07 pm
by avatar
Thanks a lot.