ICO Rsrc Maker for PB (Windows)

Just starting out? Need help? Post your questions and find answers here.
AgentOrange
User
User
Posts: 14
Joined: Sun Oct 12, 2003 3:51 am

ICO Rsrc Maker for PB (Windows)

Post by AgentOrange »

ICO Rsrc Maker for PB (Windows)

Is this program still needed in 3.8? Or is there a different way to handle this.. IncludeBinary an icon, and use it in your app for different windows/dialogs?

Code: Select all

;ICON RESOURCE EXAMPLE
;The file icon.res contain the icon, 
;if you compile this code the icon will be included inside the executable. 

resfile$="icon.res"
resfilesize=FileSize(resfile$)

;CREATE ICON , get icon handle
lpres=LockResource_(?icon) ;include binary label
hicon=CreateIconFromResource_(lpres,resfilesize,#true,196608) ;don't touch the last parameter

;window
hwnd=OpenWindow(1,100,100,200,200,#PB_Window_SystemMenu,"Resource Icons")
CreateGadgetList(hwnd)

ListIconGadget(1,10,10,150, 150,"",50) 
For x=1 To 3
  AddGadgetItem(1,x,"hello",hicon) ;use icon handle
Next

;you must destroy the icon when you no longer need it
destroyicon_(hicon)

Repeat
Until WaitWindowEvent()=#PB_EventCloseWindow
End

icon : IncludeBinary "icon.res"
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

You can use IncludeBinary and CatchImage() directly with Icons, no need
for this anymore.

Timo
quidquid Latine dictum sit altum videtur
AgentOrange
User
User
Posts: 14
Joined: Sun Oct 12, 2003 3:51 am

..

Post by AgentOrange »

freak wrote:You can use IncludeBinary and CatchImage() directly with Icons, no need
for this anymore.

Timo
Sweet, thanks!
Post Reply