Archived

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

how to load a custom icon/cursor

This topic is 5619 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

okay, this is a really stupid question, but how do I get a custom icon and cursor into my application? I already have the necessary files (the icon and cursor) and have been using the LoadIcon(...) and Load Cursor(...) functions but nothing happens. I''m using VC++ 6.0. I use the filename for the string for the second argument, any thing I''m missing here? "I am become Death, Destroyer of Worlds" -Hindu Holy Book

Share this post


Link to post
Share on other sites
www.winprog.org
sorry, can''t explain much now, just woke up.


-----------------------------
"There are ones that say they can and there are those who actually do."

"...u can not learn programming in a class, you have to learn it on your own."

Share this post


Link to post
Share on other sites
If I don''t have them as a resource in the executable, I load them using LoadImage. You have to cast the type of the return value, so for an icon:
HICON hIcon = (HICON)LoadImage(0,"myIcon.ico",IMAGE_ICON,0,0,LR_DEFUALTSIZE | LR_LOADFROMFILE);
And for a cursor:
HCURSOR hCursor = (HCURSOR)LoadImage(0,"myCursor.cur",IMAGE_CURSOR,0,0,LR_DEFUALTSIZE | LR_LOADFROMFILE);
You can also load bitmaps, just pass IMAGE_BITMAP...





Those who do not love don''t live.

Share this post


Link to post
Share on other sites