how to load a custom icon/cursor
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."
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."
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement