;-- TIME_STAMP 2021-01-21 13:19:07 v 0.1 Local $tTB = _GetTaskBarProps(True) ConsoleWrite( _ 'hWnd: ' & $tTB.hWnd & @CRLF & _ 'Autohide: ' & $tTB.autohide & @CRLF & _ 'uEdge: ' & $tTB.uEdge & @CRLF & _ 'sEdge: ' & $tTB.sEdge & @CRLF & _ 'Rect: ' & '[' & $tTB.left & ', ' & $tTB.top & ', ' & $tTB.right & ', ' & $tTB.bottom & ']' & @CRLF) ;=================================================================================================== ; Function Name....: _GetTaskBarProps ; Description......: gibt Eigenschaften und Position der Taskbar zurück ; Parameter(s).....: [optional] $_bReturnStruct - Rückgabe als (True) Struktur, (False - Standard) Array ; Return Value(s)..: Array / Struktur mit den Taskbarwerten ;=================================================================================================== Func _GetTaskBarProps($_bReturnStruct=False) Local Const $ABM_GETSTATE = 0x4 ; specify the cbSize. Local Const $ABM_GETTASKBARPOS = 0x5 ; specify the cbSize. Local Const $ABM_GETAUTOHIDEBAR = 0x7 ; specify the cbSize and uEdge. Returns the handle to the autohide appbar ; ABM_GETSTATE Local Const $ABS_AUTOHIDE = 0x1 Local Const $ABS_ALWAYSONTOP = 0x2 ; ab Win7 nicht mehr!! --> wenn NICHT $ABS_AUTOHIDE ist es $ABS_ALWAYSONTOP ; uEdge - ABM_GETAUTOHIDEBAR Local Const $ABE_LEFT = 0 Local Const $ABE_TOP = 1 Local Const $ABE_RIGHT = 2 Local Const $ABE_BOTTOM = 3 Local $hWndAppBar = DllCall("user32.dll", 'long', "FindWindowA", 'str', "Shell_traywnd", 'str', "")[0] Local $iState, $iEdge, $hWnd, $shell32 = DllOpen("shell32") Local $tRC = DllStructCreate("struct;int left;int top;int right;int bottom;endstruct") Local $tAPPBARDATA = DllStructCreate("dword cbSize;int hWnd;uint;uint uEdge;int left;int top;int right;int bottom;int") $tAPPBARDATA.cbSize = DllStructGetSize($tAPPBARDATA) $tAPPBARDATA.hWnd = $hWndAppBar ; get pos $ret = DllCall($shell32, 'int', 'SHAppBarMessage', 'int', $ABM_GETTASKBARPOS, 'ptr', DllStructGetPtr($tAPPBARDATA)) For $i = 1 To 4 DllStructSetData($tRC, $i, DllStructGetData($tAPPBARDATA, $i+4)) Next ; get state $ret = DllCall($shell32, 'int', 'SHAppBarMessage', 'int', $ABM_GETSTATE, 'ptr', DllStructGetPtr($tAPPBARDATA)) $iState = $ret[0] ; get Edge If $iState = $ABS_AUTOHIDE Then For $i = 0 To 3 $tAPPBARDATA.uEdge = $i $ret = DllCall($shell32, 'int', 'SHAppBarMessage', 'int', $ABM_GETAUTOHIDEBAR, 'ptr', DllStructGetPtr($tAPPBARDATA)) $hWnd = $ret[0] If $hWnd Then $iEdge = $i ExitLoop EndIf Next DllClose($shell32) Else If $tRC.top < 1 And $tRC.left < 1 Then If $tRC.bottom > $tRC.right Then $iEdge = 0 If $tRC.right > $tRC.bottom Then $iEdge = 1 ElseIf $tRC.top < 1 And $tRC.left > 0 Then $iEdge = 2 Else $iEdge = 3 EndIf EndIf ; return array or structure: [.hWnd, .autohide(True/False), .uEdge(0..3), .sEdge(left..bottom), .left, .top, .right, .bottom] Local $aEdge[] = ['LEFT','TOP','RIGHT','BOTTOM'] Local $aRet[] = [$hWndAppBar, ($iState = $ABS_AUTOHIDE), $iEdge, $aEdge[$iEdge], $tRC.left, $tRC.top, $tRC.right, $tRC.bottom] Local $tRet = DllStructCreate('int hWnd;bool autohide;uint uEdge;char sEdge[' & StringLen($aEdge[$iEdge]) & '];int left;int top;int right;int bottom;') For $i = 0 To UBound($aRet) -1 DllStructSetData($tRet, $i+1, $aRet[$i]) Next Return ($_bReturnStruct ? $tRet : $aRet) EndFunc ;==>_GetTaskBarProps