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.
Printable View
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.
Use SetWindowPos with the results of GetWindowPos.
Dave
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.