CreateWindowEx_() sizes are smaller than given?

Everything else that doesn't fall into one of the other PB categories.
doodlemunch
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Apr 05, 2005 11:20 pm

CreateWindowEx_() sizes are smaller than given?

Post 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!!
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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.
El_Choni
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post 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.
Post Reply