Jump to content
  • Advertisement


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


Using a Custom cursor

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

hey, I use VC++.net and I made a custom cursor for a game im making but am unable to figure out how to make it the cursor. I''ve tried setting the call of wc.hCursor= LoadCursor(NULL, IDC_WHATEVER); so the IDC_*** matches the cursor''s name but it says that that variable doesnt exist. Any1 know a way to import custom cursors from resources? -Mark

Share this post

Link to post
Share on other sites
LoadCursor(hInstance, IDC_YOURCURSOR); 

replacing hInstance by your application's instance

you can also try

hope that helps !

PS: this is untested and I never loaded a custom cursor myself

[edited by - lemurion on April 20, 2004 2:53:09 PM]

Share this post

Link to post
Share on other sites
Couple of points to check I think:

If it says IDC_WHATEVER is undefined, have you included the resource header file which VC++ defines custom resource IDs in.
It''s usually has the same name as you .rc file but with the .h header file extension instead.

lemurion is right, you will need to specify a handle to the exe containing the resource. This could either be the first HISTANCE param passed to WinMain( ... ) or you can use GetModuleHandle( NULL ) to return the currently executing module''s handle.

Finally, the resource id parameter in LoadCursor is a string. However VC++ uses integers. Integers are valid but they must be passed in the correct way. You can use the macro MAKEINTRESOURCE( IDC_WHATEVER ) to convert your id to a suitable string value.

Hope that helps.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!