Hmm, I figured out the answer to question # 2 I think. So where do I insert:
HCURSOR hc;
hc = LoadCursorFromFile("cursor.cur");
SetCursor(hc);
?
Around here?
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
DoI take out that line?
Thanks!
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
How to choose the mouse pointer?
quote:
Original post by Mike00
Hmm, 2 questions:
1) Is there a way to import a pic into the cursor creator in VC++ or do I have to draw it in there?
2) How do I save it as a .cur? VC only has the save options of .rc, .rec, and .res....
Thanks!
1) Yes, draw a bitmap in Paint/PSP/PhotoShop or another drawing program and copy it to the windows clipboard.
Open a new cursor in the resource editor and paste it.
However, to make 256 color cursors you'll need to press INS first (while editing the cursor) and select some custom options.
2) You can save the cursor as a .cur by pressing the 'save' button.
.rc is a resource file and .res is the compiled version from the .rc
When you take a look at the ResourceView (the big window at the left) you'll see that the cursor has an ID.
Usually this is something like 'IDC_CURSOR1'.
// instead of this.. wc.hCursor = LoadCursor(NULL, IDC_ARROW); // you can do this... wc.hCursor = LoadCursor(NULL, IDC_CURSOR1); // to load the cursor at the beginning of your program // // // you can also do this ofcourse HCURSOR hc = LoadCursorFromFile("mycursor.cur"); SetCursor(hc);
Edited by - richardve on July 31, 2000 4:51:14 PM
Hmm, I chose to do this one:
wc.hCursor = LoadCursor(NULL, IDC_CURSOR1);
When I hit the resource view tab on the left, it shows
mycursor resources > Cursor > IDC_CURSOR1
And on the fileview tab, under Resource Files it says
cursor1.cur, and mycursor.rc
When I run it though, I get:
error C2065: ''IDC_CURSOR1'' : undeclared identifier
Any idea what the problem is? Thanks!
wc.hCursor = LoadCursor(NULL, IDC_CURSOR1);
When I hit the resource view tab on the left, it shows
mycursor resources > Cursor > IDC_CURSOR1
And on the fileview tab, under Resource Files it says
cursor1.cur, and mycursor.rc
When I run it though, I get:
error C2065: ''IDC_CURSOR1'' : undeclared identifier
Any idea what the problem is? Thanks!
You probably missed including a header file or something. These IDs are all described in a header file. (I think it is resource.h, in the same directory of your project)
EL
----------------------------------------
"Inash neteia haeg joa kavari quilm..." SD4
EL
----------------------------------------
"Inash neteia haeg joa kavari quilm..." SD4
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement