April 6th, 1999, 05:52 AM
I want to set the window size and get the same values back.
But, what SetWindowPos() takes are not the values returned by
either GetWindowRect() or GetClientRect().
Pl. suggest.
Dave Lorde
April 6th, 1999, 05:57 AM
Use SetWindowPos with the results of GetWindowPos.
Dave
Michael Decker
April 6th, 1999, 07:08 AM
The SetWindowPos() function takes coordinates relative to the parent window. However, GetWindowRect() returns screen coordinates. So you have to call the ScreenToClient() function using the same parent window in order to get the original coordinates. The GetClientRect() function returns coordinates relative to the window being used, so the top & left coordinate is always (0,0). In all cases, the width & height are always the same.