|
|
Re: change exe icon?
[Re: D3D]
#162091
12/30/07 11:33
12/30/07 11:33
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
Here is another way that i find easier as long as windows.h is being used.
// These are for Acknex PureMode // #include <acknex.h> #include <default.c>
//Make sure you are using windows.h #include <windows.h>
/-------------------------------------------------------------
// This goes in your definition file .h or at top of your main file (where other defines are) // // EXTRA Defines #define IMAGE_ICON 1 #define ICON_SMALL 0 #define ICON_BIG 1 #define LR_SHARED 0x8000 #define LR_LOADFROMFILE 0x0010 #define LR_VGACOLOR 0x0080 #define WM_SETICON 0x0080 #define ICON_FILE 10000 //
/-------------------------------------------------------------
// This goes in your main function - "gsanim.ico" is your icon filename which should be in proj/app folder // // Set Window title SetWindowText(hWnd,"gsANIM Ver 1.00"); // Change Window style SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION|WS_SYSMENU|WS_OVERLAPPEDWINDOW |WS_CLIPCHILDREN|WS_CLIPSIBLINGS ); // Load my icon long hIcon = LoadImage(0,"gsanim.ico",IMAGE_ICON,0,0,LR_SHARED|LR_LOADFROMFILE|LR_VGACOLOR); SendMessage(hWnd,WM_SETICON ,ICON_BIG,hIcon); // Redraw the window. SetWindowPos(hWnd,NULL,0,0,0,0,SWP_DRAWFRAME|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);
/-------------------------------------------------------------
good luck.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: change exe icon?
[Re: D3D]
#162093
01/01/08 04:25
01/01/08 04:25
|
Joined: Nov 2006
Posts: 45 Germany
Tracker
Newbie
|
Newbie
Joined: Nov 2006
Posts: 45
Germany
|
I have just written a small standalone program ChangeExeIcon.exe (13 KB) in PureBasic, which is able to change the icon of an existing exe file. Please take the following into account: - start ChangeExeIcon and open the exe file at which the icon shall be changed - the icon must have the same name as the exe file (e.g. test.exe --> test.ico) - the icon must be in the same directory and must have the extension .ico - the icon has a maximum size of 32 x 32 pixel and maximum of 256 colors ======================================================================== EDIT: Sorry, I recognized that ChangeExeIcon doesn't work with published GameStudio exe files. It changes the icon, but when I start the changed exe file, I get an error "startup failure". GameStudio Icons have 536 colors, but ChangeExeIcon supports a maximum of 256 colors only. Maybe this is the reason for the startup failure. I removed the download link for ChangeExeIcon, because the program doesn't work with published GameStudio levels. ======================================================================== EDIT: Quote:
You can change the icon of the acknex.exe with a resource hacker before compiling the exe.
That's it! Published GameStudio levels contain a protection, that nobody is able to change published levels.
I made a copy of the acknex.exe in the GStudio7 folder, copied an own icon into the GStudio7 folder and renamed it to acknex.ico. Then I started ChangeExeIcon.exe, opened the acknex.exe and changed its icon this way.
After this, I published the level, I recognized that the exe file in the published version has the new icon and I was able to start the level without any problems. 
When I pressed Alt-Enter, I wondered, why the icon in the upper left corner of the window is still the A7 icon and not the new icon.
It's possible to change the icon of the exe file with ChangeExeIcon.exe, but I think, it's not the right way to work with GameStudio.
Last edited by Tracker; 01/01/08 23:24.
3DGS A7.85 Com
|
|
|
|