ICO Rsrc Maker for PB (Windows)
Posted: Thu Oct 16, 2003 1:28 am
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?
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"