Page 1 of 1
CreateWindowEx_() sizes are smaller than given?
Posted: Thu Apr 14, 2005 9:51 am
by doodlemunch
I give 1024,768 and it gives me like 990x700 or something ( im telling this by eye and also because i compared both openwindow() and the api window) and this api one is smaller! why!!
Posted: Thu Apr 14, 2005 10:36 am
by El_Choni
The width and height given to OpenWindow refer only to the client area width and height, while the values given to CreateWindowEx_ refer to the entire window width and height, including title bar, borders, etc.
Posted: Mon Apr 18, 2005 9:46 am
by dagcrack
El_Choni is right, and you can use the windows api command GetSystemMetrics (I believe it was this one :p ) to retrieve the info you need.
So you'll be practically getting the size in pixels of the "top" bar of your window, and adding that value to your height value when you create your window. I believe theres other values to be taken into account. Just don't use +XX (where XX the number, say 20 for example) at the height value or the width because many users has different settings. so its better to get the right values.