Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
In one of my samples i am loading and setting a cursor from a dll.
But cursor is not redrawn immediately after calling SetCursor().
Newly loaded cursor will be shown only if a mouse move occurs.
Can any one help me
Posted

The SetCursor function is also called by the default window procedure every time the mouse is moved if it is not captured, and set back to the one used to register the windowclass.

If you want the cursor associated to a window to reshape, you've to call SetClassLong [^]and change the associated cursor.
 
Share this answer
 
Comments
anjanarakesh 8-Dec-10 3:47am    
I have already tried using SetClassLong(). This will also take effect after a mouse movement :(
Emilio Garavaglia 8-Dec-10 7:34am    
Try forcing the mouse to move with GetCursorPos / SetCursorPos one pixel back and forward.
anjanarakesh 8-Dec-10 23:49pm    
I am calling SetcursorPos() to set the cursor position. But it wont work.
The cursor won't get redrawn until the form that it's sitting over gets refreshed or the mouse moves.

Frankly, if you're setting the mouse cursor from a .DLL that is supposed to do work and not UI stuff, you're setting the Cursor from the wrong place.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900