Solved

GetAllWindowPos()

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

Industry Leaders: 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!

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

740 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