Solved

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

Posted on 2007-11-27
6
855 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
[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
  • 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
Technology Partners: 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

751 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