Click to See Complete Forum and Search --> : Window size and documentation conflict


Gyannea
March 12th, 2003, 02:58 PM
The three functions
CreateWindow()
GetClientRect()
GetWindowRect()

are somehwat in conflict with my documentation.

In CreateWindow() I specify the window position and size with

0,0,100,100.

Then I call
GetClientRect() and GetWindowRect(). I want to get the size of the window frames.

Heres what I get:
clientrect.left = 0
clientrect.top = 0
clientrect.right = 111
clientrect.bottom = 42

windowrect.left = 0
windowrect.top = 0
windowrect.right = 123
windowrect.bottom = 100

It seems that the CreateWindow() function 'width' value gives the width of the client area, not the window, whereas the 'height' value gives the height of the window and not the client.

Is this a known feature? That's not what my documentation says!

poccil
March 12th, 2003, 08:41 PM
I assume that Windows inherently sets a minimum width and minimum height of the window, so that the user doesn't resize it so much that it becomes hard to find.

Gyannea
March 13th, 2003, 04:55 AM
You are right. That was exactly the problem. Setting the width to 100 was below some internal minimum and Windows changed it to something else. When I set the width ro 200, that was no longer the case. So all I did was to let widnows decide the window size and take the difference between the client and window rectangles.