Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why _screen w/o tittle bar cover taskbar?
Message
From
30/06/2009 05:31:31
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01409112
Message ID:
01409292
Views:
49
>>>>>>May be subtract the task bar height from the _screen height?
>>>>>This could be very tricky if the user set "Auto-Hide Taskbar" to true :-)
>>>>
>>>>Better than have it covered :)))
>>>
>>>Now you put me in meditation :-)))))
>>>How can I find Taskbar height :-)
>>>(Start searching for APIs)
>>
>>
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 your 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)
>
>
>Thank you Mike

Borislav,

Just something I like to point out:

The taskbar is not restricted to bottom. It might be moved it to any boundary

(And the calclation width height of a taskbar on left border might create fancy results ...)

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform