Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why is VFP hiding the taskbar
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096539
Message ID:
00096595
Views:
13
>I am trying to set the main VFP window to maximise and use it instead of a main form to house the other forms of my application. I would therefore prefer if this window cannot be restored to any other size and only be minimized or quitted. To accomplish this I have issued the following commands in a UDF called at the start of the application - _screen.windowstate = 2 and _screen.maxbutton = .f. . The problem is that the VFP window hides the taskbar although the taskbar is fixed at the bottom of the screen and it's properties are set to always on top. I'll be gratefull if anyone can tell me why this is happeing and how to get around it...

Hi Robert,

You may decrease the VFP window height:
_Screen.height = _Screen.height - 31 && 31 is an approximate value of TaskBar height + 1

also you may calculate exact size of the TaskBar by using a WinAPI function SHAppBarMessage().

_Screen.height = _Screen.height - GetTaskBarHeight() - 1

*--//----------------------------------------------------
*--// this function retrieves the TaskBar height
*--//----------------------------------------------------
function GetTaskBarHeight
#define ABM_GETTASKBARPOS 5
declare INTEGER SHAppBarMessage in shell32 LONG dwMessage, STRING @pabd
local lcPADB, lnHeight
lcPADB = repl(chr(0), 40)
SHAppBarMessage( ABM_GETTASKBARPOS, @lcPADB)
return StrToDec( subs( lcPADB, 29, 4)) - StrToDec( subs( lcPADB, 21, 4))
endfunc
*--//----------------------------------------------------
*--// this function converts String to Decimal number
*--//----------------------------------------------------
function StrToDec( tcStr)
local lnDecVal, lnI
lnDecVal = 0
if type( 'tcStr') = 'C'
for lnI = len( tcStr) to 1 step -1
lnDecVal = lnDecVal * 256 + asc( subs( tcStr, lnI, 1))
endfor
endif
return lnDecVal
endfunc
*--//----------------------------------------------------

Best regards

Alexander.
Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform