LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a custom mouse cursor

Hello,
Want to use a custom mouse cursor in my application .
But cannot get the expected result. Please see the attachment , hope give an advise . thanks.

David
0 Kudos
Message 1 of 4
(3,190 Views)
Hello David,

Can you clarify what kind of unexpected behavior you are receiving?


Wendy L
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,190 Views)
Hi Wendy,

When click the "cursor" button , hope can change the mouse cursor to the defined type , the "HELP.CUR" , but once doing this ,can not see any changes .

David
0 Kudos
Message 3 of 4
(3,190 Views)
Hello David,

Your cursor is being set to the image HELP.CUR, but CVI will reset the cursor later in the UI library. To verify this, add a breakpoint on the "break" statement of your cursor button callback. You will notice that your cursor is replaced by the specified image. The correct way to use the SDK to do this is to track when the window is active (or when the mouse is in the window's client area), and then call SetCursor. Note that before doing this, the class cursor should be set to NULL, to prevent user32.dll from resetting the cursor on a mouse move. I have attached code showing how to do this with a timer callback. Alternatively, one can also track mouse moves, and set the cursor on mouse move events. Refer to the SDK
documentation on cursors, SetCursor, etc for more information.
Download All
Message 4 of 4
(3,190 Views)