Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ironhell3

Adding an icon to my project

This topic is 6110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i have a rather silly question, how can i add an icon to my exe? i know i have to do it in VC 6++ by using the add resource from the menu, but then how do i enable this icon? Sorry, but i searched a lot but couldn''t find an answer to my problem Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
When defining your window class make sure to have this line

wc.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(ID_MYICON));

Or you can change your window''s icon at any time my calling this:

SetClassLong(hwnd, // window handle
GCL_HICON, // changes icon
(LONG) LoadIcon(hinst, MAKEINTRESOURCE(ID_MYICON))
);


Of cource, substitute ID_MYICON with your resource.

Share this post


Link to post
Share on other sites
Don''t forget to #include "resource.h"

For a working example visit my site and download the Eyescream Framework code!



-------- E y e .Scream Software --------
----------------------------------------
                                  /-\
    http://www.eyescream.cjb.net | * |
                                  \-/
----------------------------------------

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!