Window metrics in Win32
Richard Gaskin
ambassador at fourthworld.com
Wed Jan 22 16:53:01 EST 2003
The two functions below are used in an app I'm building to help me calculate
window rects, the goal being to have them tightly abutted but not
overlapping.
My routines seem to work great in Win95, 98, ME and 2k (beautiful
edge-to-edge placement), but are causing odd window placement on Win NT and
XP.
Are the registry settings I'm using supported on those platforms? Or is
there some obvious logic error in my functions that I'm just not seeing?
Thanks in advance -
function WdMargin
global g4WWinMargin
if the platform is "MacOS" then
put 6 into g4WWinMargin
else
get queryRegistry("HKEY_CURRENT_USER\Control
Panel\desktop\WindowMetrics\BorderWidth")
if it is not a number then put 2 into g4WWinMargin
else
put it into g4WWinMargin
if (isNumber(it)) then
put round(it / -15) into g4WWinMargin
end if
end if
end if
return g4WWinMargin
end WdMargin
function TitleBarHeight
get queryRegistry("HKEY_CURRENT_USER\Control
Panel\desktop\WindowMetrics\CaptionHeight")
if it is a number then
put round(it / -15) into tHeight
return tHeight
else return 22
end TitleBarHeight
--
Richard Gaskin
Fourth World Media Corporation
Developer of WebMerge 2.1: Publish any database on any site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list