setcursorpos - relative to a top level window?

Posted on 2007-11-27
Medium Priority
Last Modified: 2012-06-09

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?
Question by:Troudeloup
LVL 55

Accepted Solution

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);

Author Comment

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


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

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