?
Solved

setcursorpos - relative to a top level window?

Posted on 2007-11-27
2
Medium Priority
?
88 Views
Last Modified: 2012-06-09
http://msdn2.microsoft.com/en-us/library/ms648394.aspx


setcursor  originally move cursor to screen coordiants.

but i want to move the mouse to relative position inside a window,


in other words, relative_setcursorpos( 200, 200 )  would move it to the same position regardless of where the window moves to.


is there such a solution?
0
Comment
Question by:Troudeloup
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 20362443
having a 'p' point with relative coordinates:

POINT p;   // fill this somewhere
p.x = 200;
p.y = 200;
ClientToScreen(yourHwnd, &p);
SetCursorPos(&p);
0
 

Author Comment

by:Troudeloup
ID: 20362484
will you also take a look of this one?


http://www.experts-exchange.com/Programming/Languages/CPP/Q_22983831.html


it takes DC with a one liner so it's a bit tricky to save that DC to a screenshot
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

807 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