Solved

Moving cursor with WM_SETCURSOR

Posted on 2003-11-26
2
2,444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 9824388
Try SetCursorPos function.
0
 
LVL 44

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

635 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