icon ?

BlitzPlus Forums/BlitzPlus Programming/icon ?

Kuron(Posted 2004) [#1]
Stupid ? Went to change the icon in my B+ EXE I just compiled and we no longer have an icon to change. How do you add an icon to an existing EXE that has no icon?


Eikon(Posted 2004) [#2]
Use ResHacker and goto Add Resource, name it "ICON", and point it to the .ico you want to attach.

http://www.users.on.net/johnson/resourcehacker/


Kuron(Posted 2004) [#3]
Woohoo thanks Eikon.


Grisu(Posted 2004) [#4]
Two additions, that might be of some use for you.

1.
You only can compress the exe with upx "after" the changes made with resouce hacker.

2.
You can also change the window and taskbar icon:
http://www.blitzcoder.com/cgi-bin/code/code_showentry.pl?id=grisu02092004223950&comments=no


matt!(Posted 2004) [#5]
I still can't get this to work. Does the icon need to be a single icon file or can it have multiple sizes specified in it? I am usign Microangelo.


DrMartin(Posted 2004) [#6]
I've tried the window/taskbar icon example, and it doesn't work. Has anybody gotten it to work? What's upx?


Eikon(Posted 2004) [#7]

I've tried the window/taskbar icon example, and it doesn't work.


Putting
hWnd=GetActiveWindow()
icon=LoadIcon(hWnd,"icon.ico", 0)
SetClassLong(hwnd,-14,icon)
under my Graphics or B+ window always worked for me. MeArrin69 has had similar problems, so he made a DLL to solve them. You can try his solution:
http://www.blitzcoder.com/cgi-bin/ubb-cgi/postdisplay.cgi?forum=Forum6&topic=001248


What's upx?


A program that compresses EXE files and requires no software to extract them at runtime. If you've ever seen a Blitz EXE smaller then 700kb, this is what they used:
http://upx.sourceforge.net/


DrMartin(Posted 2004) [#8]
My function calls has User32_ in front of them, otherwise my code is exactly like yours. I'm gonna try the other DLL, but this is a bit weird I think.


matt!(Posted 2004) [#9]
Thanks Eikon, I wasn't putting it after my Window creation! (oops)