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

Posted on 2007-11-27
Last Modified: 2012-06-22

BOOL GetCursorPos(      
    LPPOINT lpPoint

what is ?


also, how do I make it return relative to the a top level window's position?
Question by:Troudeloup
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
LVL 55

Expert Comment

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

LPPOINT means pointer to a POINT variable

Author Comment

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


how about returning screen coordiates?
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20362461
I have answered that in your other question
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

ID: 20362494
which one?

also, did you mean "that" by

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

LVL 55

Accepted Solution

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

Author Comment

ID: 20362533

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