Forum > LCL
ClientHeight and Height return same size
rpetges:
Hi,
I'm running Lazarus 2.0.12 on Windows 10 ( 100% DPI scaling ).
The Height property of a window should return the number of pixels, including title bar. However, during my tests, Height and ClientHeight return the same values. In fact, the titlebar height ( around 30 pixels ) is missing when using the Height property.
Any idea how to get the full height of a window ?
Many thanks.
Bart:
Read the FAQ please.
Bart
rpetges:
Aaaah, that explains. Thanks for the link.
While my application is only running on Windows, I will use ClientHeight and get the frame width and title bar height with the GetSystemMetrics function.
jamie:
Please read this link
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowrect
Starting with vista the drop shadow is part of the window frame and the GetWindowRect will report that as part of the window size.
Reading the link you can find out how to obtain the actual frame size you are seeing.
Beware that if you expect your code to work in earlier OS versions Like i do, it's wise to dynamically link the procedure address in for this call at runtime and if it fails then you can use what ever the GetWindowRect returns..
rpetges:
Thanks for the info, I'll have a look.
Navigation
[0] Message Index
[#] Next page