Change the Icon of my OGL .exe...
how do you change the icon of an .exe file? i wrote this little openGL application so i go to right click-> properties and no button to change the icon, to my dismay and surprise. actually if i make a shortcut to it then yes you can change the icon, but that means there is an embedded path into the .exe and once you take it to another machine it will barf all over you and say "cannot find ../../MSVC../.exe, path has been removed or moved.
i have this problem because my openGL app cannot run through a basic drag and drop. the .exe has to accept more than one argument, such like *.exe -t something.jpeg something.bmp. what i wanted to do was change the path in the properties of the .exe so you dont have to go to cmd line prompt and type that in. you can just double click.
*********
so in essence can you change the icon of a .exe without the embedded shortcut path file name that windows creates when you do this?
heh
ok im asuming your using vcpp and are using the nehe basecode.
fist create a resourcefile and add the icon to that, the icon id should be IDI_ICON1.
then in the main file(where the winmain func is) just under the includes add this line
#define IDI_ICON1 102
then in function RegisterWindowClass or wherever you register the window class, somewhere before RegisterClassEx though.
add this(or replace if it allready exist).
windowClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
It might not fit exactly into your code, but it''s a start.
---------------------------------
For an overdose of l33tness, flashbang.nu
fist create a resourcefile and add the icon to that, the icon id should be IDI_ICON1.
then in the main file(where the winmain func is) just under the includes add this line
#define IDI_ICON1 102
then in function RegisterWindowClass or wherever you register the window class, somewhere before RegisterClassEx though.
add this(or replace if it allready exist).
windowClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
It might not fit exactly into your code, but it''s a start.
---------------------------------
For an overdose of l33tness, flashbang.nu
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
If your using NeHe basic openGL code then the above icon formatting should work properly. Just insert your specific words for winclass and IDI_ICON. I also think that MSVC++ will define the icon automatically in the resource.h files, so you dont exactly have to worry about that.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement