Adding an icon to my project
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!
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.
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.
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 | * |
\-/
----------------------------------------
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
Popular Topics
Advertisement