Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#52: How can I get the sizes of some system controls?

Sometimes in run-time you must detect the sizes of some system controls. For example, width of scrollbar or height of form caption etc.

If you want to get this system value, you must call the Windows API's function GetSystemMetrics with different parameter. In result you'll get the wished. For example,

intFormCaptionHeight := GetSystemMetrics(SM_CYCAPTION)

As result, you in intFormCaptionHeight you have a height of normal caption area in pixels.

The full list of wished system metrics you can view in Windows API's help by GetSystemMetrics topic.

The some useful metrics:
SM_CMOUSEBUTTONS - number of buttons on mouse
SM_CXFULLSCREEN, SM_CYFULLSCREEN - width/height of the client area for full-screen window
SM_CXHSCROLL, SM_CYHSCROLL - width/height of the arrow bitmap on horizontal scrollbar
SM_CXSCREEN, SM_CYSCREEN - width/height of the screen
SM_CXSIZE, SM_CYSIZE - width/height of a button in window caption


Published: December 9, 1999

See also
 
Paradox to MS Access converter
ABA Database Convert
Excel Web-stream
SMExport suite
Mail parser (ActiveX)
Clarion to Text converter
DBLoad
SMReport
Fast Document Viewer
DBExport tools
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2024, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising