Get height of Taskbar

Started by Jeremy Whilde, February 04, 2017, 02:59:55 AM

Previous topic - Next topic

Jeremy Whilde

I need to sit a dialog on top of the taskbar whatever the resolution of the monitor being used, at 1920x 1080 the taskbar seems to be 18 units tall, not sure if these are pixels or WB screen units or something else. So I thought I would try and write a function as below using WinMetrics to get the height of the taskbar, this however does not see to return 18 units is there a reliable way to do this?

Thanks JW

;===========================================================
; Get height of taskbar ??
;===========================================================

#DefineFunction tbHeight()
               FullHeight = WinMetrics(17) ;/WinMetrics(-5) ; To convert to Winbatch screen units???
               Height  = WinMetrics(1)                ;/WinMetrics(-5)
                a = Height - FullHeight
                Return a
#EndFunction


; Set window position to lower right corner if no XY position stored (First start position)
;MyDialogWidth=064
MyDialogHeight=021      ; Need this because dialog code is after this
ScreenWidth = WinMetrics(0)
ScreenHeight = WinMetrics(1)
PpHDU = WinMetrics(-6)
PpVDU = WinMetrics(-5)

;Lower Right
;MyDialogX = int(Floor(ScreenWidth/PpHDU-MyDialogWidth))
retvalue = int(Floor( ( ScreenHeight - WinMetrics(4))/PpVDU-MyDialogHeight)) -18 ;- tbHeight()

....IFICantBYTE

Try searching for "taskbar" in the Tech Database and things like the following articles should help...

W18459 GetWorkArea Window Resize

W17711 Areo Window Borders Issue
Regards,
....IFICantBYTE

Nothing sucks more than that moment during an argument when you realize you're wrong. :)