You are viewing limited content. For full access, please sign in.

Question

Question

Changing the Mouse Cursor using Pinvoke Win API Document Viewer

SDK
asked on May 12, 2014

Hello all,

 

I have written a custom application in C# and invoke it via a button using CAT.  The user would perform and action on the document viewer and it is working fine.  The only problem is the mouse cursor on the viewer is the default magnifying glass and I am unable to change using Windows API to a custom cursor.  Any help would be appreciated.

 

Thanks 

0 0

Answer

SELECTED ANSWER
replied on May 12, 2014

When the cursor enters your program's window, Windows will send the WM_SETCURSOR message to the window. Call SetCursor then. If you don't handle the WM_SETCURSOR message and call SetCursor, then Windows will automatically call SetCursor with the window class' cursor handle. This is why it's insufficient to call SetCursor just once in your program to switch to a custom cursor.

0 0

Replies

replied on May 12, 2014

Allen,

 

Thanks for the response.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.