Solved

GetAllWindowPos()

Posted on 1999-01-25
2
365 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
[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
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

729 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