Link to home
Start Free TrialLog in
Avatar of ab11
ab11

asked on

Moving cursor with WM_SETCURSOR

Hi !

I am trying to move cursor manually in my sample dialog application by doing:

POINT pt;
::GetCursorPos(&pt);
SendMessage(WM_SETCURSOR,NULL,MAKELPARAM(pt.x+10,pt.y));

This doesn't work although in Spy++ I can see that my dialog gets the correct LPARAM.
I tried also to use WM_MOUSEMOVE, but the result was the same.

What do I miss ?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndyAinscow
SetCursorPos(x, y) where x and y are in screen coordinates, returns TRUE on success.
The functions ClientToScreen and ScreenToClient can be used to adjust a point from your app's co-ordinates to/from the screen co-ordinates if you require that.