Solved

Moving cursor with WM_SETCURSOR

Posted on 2003-11-26
2
2,371 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 200 total points
Comment Utility
Try SetCursorPos function.
0
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now