Jump to Real's How-to Main page

Resize a window because XP window title is bigger

XP theme, when in used, makes the title window bigger. But if the window design was done with a traditional Windows, you may lose information in the windows bottom area.

This snippet will detect if the title is bigger than the traditional one. If it's bigger then the window is resized.

[local function declaration]
FUNCTION integer GetSystemMetrics ( int nIndex ) LIBRARY "user32.dll"

[window open event]
CONSTANT integer SM_CYCAPTION = 4
integer li_pixels, li_pbunits

li_pixels = GetSystemMetrics(SM_CYCAPTION)
li_pbunits = PixelsToUnits(li_pixels, YPixelsToUnits!)

this.height = this.height + ( li_pbunits - 76 )

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]