Solved

GetAllWindowPos()

Posted on 1999-01-25
2
353 Views
Last Modified: 2008-02-01
I want to get the possition of a child window, and the main window Like this:

RECT GetWindowPos(hwnd); {But if i call the get rect function, it tells me that my rect.left always = 0
0
Comment
Question by:win32
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 10 total points
ID: 1185114
I think you mean GetWindowRect

RECT rect ;
::GetWindowRect( hWnd, &rect ) ;

This will return screen coordinates of a window.  If you need them in client coords (e.g. for a child) use ScreenToClient

::ScreenToClient( GetParent(hWnd), (LPPOINT)&(rect.left) ) ;
::ScreenToClient( GetParent(hWnd), (LPPOINT)&(rect.right) ) ;
0
 

Author Comment

by:win32
ID: 1185115
Year That works fine Thanks !!
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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

840 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