Solved

getcursorpos - how do I get relative to a window?  also, what's lpoint?

Posted on 2007-11-27
6
848 Views
Last Modified: 2012-06-22
http://msdn2.microsoft.com/en-us/library/ms648390.aspx


BOOL GetCursorPos(      
    LPPOINT lpPoint
);

what is ?

LPPOINT lpPoint



also, how do I make it return relative to the a top level window's position?
0
Comment
Question by:Troudeloup
  • 3
  • 3
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20362431
POINT p;
GetCursorPos(&p);
ScreenToClient(yourHwnd, &p);

LPPOINT means pointer to a POINT variable
0
 

Author Comment

by:Troudeloup
ID: 20362453
wait a minute, does it mean it returns the relative position in the window directly?

wow

how about returning screen coordiates?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20362461
I have answered that in your other question
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Troudeloup
ID: 20362494
which one?

also, did you mean "that" by

a)  , does it mean it returns the relative position in the window directly?
or
b)  returning screen coordiates?

0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20362514
The name of the function explains all:
ScreenToClient() converts a screen coordinate into a client (window) coordinate
ClientToScreen() converts a client coordinate into a screen coordinate
0
 

Author Comment

by:Troudeloup
ID: 20362533
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

740 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