Monday, April 25, 2011

How to I set the cursor to the Drag Copy/Move cursors in Win32?

It doesn't seem to be one of the standard cursors (like IDC_ARROW), so how can I load this?

From stackoverflow
  • You need to add a custom cursor as a resource to your application, get the resource handle, and then use SetCursor(...)

    The drag/copy/move cursors aren't part of the standard library - your application will need it's own. The standard cursors are all listed here:

    http://msdn.microsoft.com/en-us/library/ms648391(VS.85).aspx

    That being said, IDC_HAND does exist on newer operating systems, which may be what you are looking for...

    wchung : Darn, we're deploying for multiple windows platforms including Vista/XP, so I guess we would have to bundle icons for each?
    Reed Copsey : Not necessarily. You can use teh same icons on XP + Vista. Vista does add the ability to have higher quality icons, though, so if you want them to look as nice as the other icons on vista, you'll need multiple resources.
    wchung : Sorry, I meant cursor, not icon -- since vista/xp seems to have different plus/move cursors. Thanks though.
    Reed Copsey : Yeah - same issue, though. You'd just need to load multiple icons into your resource file, and pick the one you want.

0 comments:

Post a Comment