Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Moving cursor with WM_SETCURSOR

Posted on 2003-11-26
2
Medium Priority
?
2,541 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:ab11
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 800 total points
ID: 9824388
Try SetCursorPos function.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 9824428
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.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question