How do I add an icon to the EXE ?
BlitzPlus Forums/BlitzPlus Programming/How do I add an icon to the EXE ?
| ||
Just bought BB+ But it seems to be missing something basic. How do I add an icon to the exe it creates??? Tom |
| ||
res hacker |
| ||
I tried Reshacker. Problem is it seems that there is no icon resource at all. Is there something wrong with my Blitz??? Its not making ANY icons. |
| ||
BlitzPlus doesn't include an icon when you make executables. With Win32 EXEs, if there's already an icon there then it can be changed. If there isn't one, then you can't add one. |
| ||
Which is a bit crap really, isn't it? Feature request? |
| ||
Use ResHacker again, this time "correctly" ;) Open up the EXE in ResHacker, in the "Action" Menu, select "Add new resource". Click the "Open file with new resource..." button. Load up an icon file (.ICO) and type ICON in the "Resource Name" field. Click "Add Resource". Now.. use "Save As..." and save out the new EXE with a different name (This ensures you don't lose the original). NOTE: DO NOT UPX the EXE before adding the Icon, this will not work the best at all. Instead UPX after, this will be fine. |
| ||
res hacker :) It works with B+ Follow snarty advice |
| ||
Snarty: You rock. Thanks... BTW: I got it to work ok, but when I execute the program the title bar of the window still does not contain an icon even though my ICO file has every state saved within. I'll keep playing with it maybe I messed up somewhere. Tom. |
| ||
No worries :o) Anyhow, had a quick play with the API, here's what you can do. hWND=QueryObject(MainWindow,1) Icon=LoadIcon(hWND,CurrentDir()+"blankpage.ico",0) SetClassLong hWND,-14,IconAdd these commands to the relevant .decls. .lib "user32.dll" SetClassLong(hWnd%,nIndex%,Value%) : "SetClassLongA" .lib "shell32.dll" LoadIcon%(hWND%,File$,Index%) : "ExtractIconA" Then you can pop the .ico file you want anywhere you want and load from there. You can also grab from the resource, but this was just a quick way to load a "File" into the current Blitz window. |
| ||
reshacker...:) |
| ||
Akat, snarty just provided a better solution. |
| ||
Thank You Snarty!!!! |
| ||
No prob Tom, Just ignore Akat, he prob can't read :o) |
| ||
Maybe AppIcon would...<dodges tomatoes>..do the...<runs offstage>...trick! :P Russell |