Resize a window because XP window title is biggerTag(s): WinAPI/Registry


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 )

blog comments powered by Disqus