Solved

GetAllWindowPos()

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 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.

758 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

19 Experts available now in Live!

Get 1:1 Help Now