Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sysmetric
Message
From
05/06/2018 14:19:28
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01660550
Message ID:
01660573
Views:
81
Hi Mike!

Doesn't work. When I do a

messagebox( TaskBarHeight())

it returns .t.



>>Hello all!
>>
>>Looks like sysmetric is not enough to garanty a good definition of of the maximum height and maximum width of a screen.
>>
>>I have those definitions
>>
>>thisform.width = SYSMETRIC(1) - SYSMETRIC(3) - SYSMETRIC(12)
>>thisform.Height = SYSMETRIC(2) - SYSMETRIC(4) - SYSMETRIC(13) - SYSMETRIC(29)
>>
>>What am I missing?
>You may want to also find out the Height of the taskbar at the bottom, and add it to the height of the screen:
>
TaskBarHeight()
>Function TaskBarHeight
>Declare Integer GetWindowRect In user32;
>   INTEGER HWnd, String lpRect
>Declare Integer FindWindow In user32;
>   STRING lpClassName,;
>   STRING lpWindowName
>
>Local cBuffer
> cBuffer = Replicate(Chr(0), 16)
> hWindow= FindWindow('Shell_TrayWnd', '')
> cRect = GetWinRect(hWindow)
> ?  "The height of the taskbar is: "+trans(buf2dword(Substr(cRect, 13,4))-buf2dword(Substr(cRect, 5,4)))
>Function GetWinRect(hWindow)
>Local cBuffer
> cBuffer = Replicate(Chr(0), 16)
> = GetWindowRect(hWindow, @cBuffer)
>Return cBuffer
>Function buf2dword(lcBuffer)
>Return Asc(Substr(lcBuffer, 1,1)) + ;
>   BitLShift(Asc(Substr(lcBuffer, 2,1)),  8) +;
>   BitLShift(Asc(Substr(lcBuffer, 3,1)), 16) +;
>   BitLShift(Asc(Substr(lcBuffer, 4,1)), 24)
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform