Solved

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

Posted on 2007-11-27
6
833 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

813 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

10 Experts available now in Live!

Get 1:1 Help Now