size of window decorations

Claus Dreischer claus at dreischer.de
Thu Jan 6 11:43:21 EST 2011


Hello Richard,

thanks for that snippet, but it returns 1 here, which is not like in
Klaus' table, or i completely misunderstood you.

But you gave me a pointer: I think i can frickel something when i use
this key too to get the height of the decorations:

HKEY_CURRENT_USER\Control Panel\desktop\WindowMetrics\CaptionHeight

At least it changes from -375/15 (XP Style) to -270/15 (Classic Style) ...


Regards,
	Claus.



Am 06.01.11 16:31, schrieb Richard Gaskin:
> Claus Dreischer wrote:
> 
>> is there a way to determine the size of the window decorations (the
>> stuff the OS is painting around my stack)?
>>
>> I would like to move my stack into the upper left corner, but without
>> the knowledge of the real height of the whole window (stack + window
>> decorations), i don't know how much i should add to the height of this
>> stack.
>>
>> This also depends on the window style (classic 2000, XP, Vista, etc).
>>
>> Is there a way?
> 
> On Mac the window size isn't customizable, so you can measure a screen
> shot and be done with it.
> 
> For Windows, Klaus' list is very helpful for the default values, but
> because those can be adjusted by the user in their Control Panel it may
> be better to work from the registry setting for that.
> 
> Here's a snipped of a routine I use to place windows(be mindful of email
> text wrapping):
> 
>   if last word of the systemVersion >= 6 then
>       get queryRegistry("HKEY_CURRENT_USER\Control
> Panel\desktop\WindowMetrics\PaddedBorderWidth")
>     else
>       get queryRegistry("HKEY_CURRENT_USER\Control
> Panel\desktop\WindowMetrics\BorderWidth")
>     end if
>     if (it is not a number) or ( it = 0) then put 1 into g4WWinMargin
>     else
>       put round(it / -15) into g4WWinMargin
>     end if
> 
> 
> Note that the reg key used differs by OS version.  An unnecessary drag,
> IMO, and cost me a bit of time turning it up when Vista came out, but
> good to know when you need it.
> 
> -- 
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list