Solved

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

Posted on 2007-11-27
6
816 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
Comment Utility
POINT p;
GetCursorPos(&p);
ScreenToClient(yourHwnd, &p);

LPPOINT means pointer to a POINT variable
0
 

Author Comment

by:Troudeloup
Comment Utility
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
Comment Utility
I have answered that in your other question
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Troudeloup
Comment Utility
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
Comment Utility
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
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 clear a vector as well as how to detect empty vectors in C++.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now