Adding an icon to my project

Started by
4 comments, last by ironhell3 22 years, 1 month ago
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!
Advertisement
put an icon in your project''s resource file, and give it an id of -1
Yes, and then? How can i <> from our code? is there a command or what?

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.
-------------------------------------------------------BZZZZTT - CRASH - BANG"What was that?!""Captain, it appears that we have encountered a strange sub-space anomaly. I'm getting a high reading of tracheons beams. The anomaly seems to be some kind of rift in the space-time continuum. -- Never mind, Bones was just using the microwave again."
Thanks a lot! i will try it!
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 | * |
                                  \-/
----------------------------------------

This topic is closed to new replies.

Advertisement