Advertisement

how to load a custom icon/cursor

Started by July 23, 2002 09:27 AM
2 comments, last by Deathscythe047 22 years, 3 months ago
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
"I am become Death, Destroyer of Worlds"-Hindu Holy Book
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."

-----------------------------"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."
Advertisement
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.
[My Lousy Page | Kings Of Chaos | Vampires | [email=lordlethis@hotmail.com]email.me[/email]]
tnx, that helped. should''ve known that.

"I am become Death, Destroyer of Worlds"
-Hindu Holy Book
"I am become Death, Destroyer of Worlds"-Hindu Holy Book

This topic is closed to new replies.

Advertisement