Hi!
Im thinking about writing an EXE Bundler. I have created a method
to pack and unpack file with filenames, so no problem there. But now i wonder, how can i let the user choose the icon of the final exe?
The final exe is built like this:
Uncompresser
Packed files+filetag
Its like an exe that gets a packed file in the end, and then it can uncompress those files and run and delete them..
How do i let the user change the icon of my uncompresser (the program the enduser runs.)
adding icon to executable
I can( figure out how to find the icon"s handle when the app is running.
I searched WinAPI docs but nothing answers well right now.
I will let it open some more time and try again.
Rgrds
I searched WinAPI docs but nothing answers well right now.
I will let it open some more time and try again.
Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
The API doesn't help, because ResourceChange don't work under 9X-Systems (and the unicode-dll doesn't work, or i don't see any working code).
ResHacker can change Resourcen and it has a script-support.
When you use jaPBe:
Hold shift (don't release!)
Projekt>Create executeable
Select a name
OK
During the compiling DON'T RELEASE shift.
After some times, a dos-box should appear with the linker-commands. Now go to the purebasic\compilers directory and copy all the lib, obj which are named in the dos-box. Also copy the complete command-string out of the dos-box.
Now you have the to link files and the command-string to create the exe and to change the icon.
the icon is in the _japbe_0.obj (the source for this resource you found in _japbe_0.rc) Change the source of this obj, create a obj-file (for example with gorc), then start the linker with command-string and you get a exe with your own icon and your own version string, and so on...
ResHacker can change Resourcen and it has a script-support.
When you use jaPBe:
Hold shift (don't release!)
Projekt>Create executeable
Select a name
OK
During the compiling DON'T RELEASE shift.
After some times, a dos-box should appear with the linker-commands. Now go to the purebasic\compilers directory and copy all the lib, obj which are named in the dos-box. Also copy the complete command-string out of the dos-box.
Now you have the to link files and the command-string to create the exe and to change the icon.
the icon is in the _japbe_0.obj (the source for this resource you found in _japbe_0.rc) Change the source of this obj, create a obj-file (for example with gorc), then start the linker with command-string and you get a exe with your own icon and your own version string, and so on...
...,
If you would like the user to be able to change the program icon, you may find your way looking there and adapting the code. You will need to g further with API to understand how to get compatible icons from files or generate it by yourself.
Here I use a tip to change program icon on the fly using standard icons which constants are numbered from 32512 to 32517 !
If you would like the user to be able to change the program icon, you may find your way looking there and adapting the code. You will need to g further with API to understand how to get compatible icons from files or generate it by yourself.
Here I use a tip to change program icon on the fly using standard icons which constants are numbered from 32512 to 32517 !
Code: Select all
;
; Main starts here
;
Quit = #FALSE
WindowXSize = 320
WindowYSize = 240
Resource.l = #IDI_APPLICATION
tz = GetTickCount_()
If OpenWindow(0, 0, 0, WindowXSize, WindowYSize, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered, "MyWindow")
AddKeyboardShortcut(0, #PB_Shortcut_Escape, #PB_Shortcut_Escape)
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
Quit = #TRUE
Case #PB_Event_Menu
Select EventMenuID()
Case #PB_Shortcut_Escape
Quit = #TRUE
EndSelect
Case #PB_EventGadget
Select EventGadgetID()
EndSelect
Case #WM_LBUTTONDOWN
ReleaseCapture_()
SendMessage_(hWnd, #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
Default
EndSelect
If GetTickCount_() - tz > 1000
Resource + 1
If Resource > #IDI_WINLOGO
Resource = #IDI_APPLICATION
EndIf
DestroyIcon_(hIcon)
hIcon = LoadIcon_(0, Resource)
SendMessage_(WindowID(), #WM_SETICON, 0, hIcon)
tz = GetTickCount_()
EndIf
Delay(1)
Until Quit
EndIf
TerminateProcess_(GetCurrentProcess_(), 0)
End
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.


