Sign in to follow this  
clearz

Coding in an exe icon

Recommended Posts

Hi I am using MS VC++ Express 2005 Beta 2 to learn to program Direct3D. This is fine only that it dosent allow you to use the Resource Editor. I am just finnishing up my first game and want to add an icon to the exe instead of that ugly default window icon. Is there a way to manually code in an icon using a .ico file or do I need to use the resource editor. Thanks.

Share this post


Link to post
Share on other sites
Hmm...for C++ I use dev-cpp and you dont have to code in a icon. You just add it in project properties or something. Check the help file! :)

Hope I helped

Cheers!

Share this post


Link to post
Share on other sites
Code the following in your resource file:
IDI_PRGM ICON DISCARDABLE "icon.ico"

The name "icon.ico" is the name of the icon file you wish to compile into your program.

Code this for the member icon within your windows attributes strucuture:
wc.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PRGM));

This will find and utilize the icon when your program runs.

Make sure to create a #define numeric value for it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this