回复 7# netegg
蛋兄,还是没反应。能麻烦一下你,帮忙测试一下吗?晕菜ING
#include<winapiex.au3>
;~ ;查找任务栏的句柄
Local $winhwnd = DllCall("user32.dll", "hwnd", "FindWindow", "str", "Shell_TrayWnd", "str", "")
;~ ;获取任务栏的左上角,和右下角坐标
Local $apihw = DllStructCreate("long x;long y;long c;long d")
DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $winhwnd[0], "ptr", DllStructGetPtr($apihw))
$x = DllStructGetData($apihw, "x") ;左上X坐标 0
$y = DllStructGetData($apihw, "y") ;左上Y坐标 860
$c = DllStructGetData($apihw, "c") ;右下x 坐标 1440
$d = DllStructGetData($apihw, "d") ;右下Y坐标 900
Local $heghit = $d - $y
Local $Var = 3
_WinAPI_ShellAppBarMessage($Var)
Func _WinAPI_ShellAppBarMessage($Message)
Local $tagAPPBARAPPBARDATA = "DWORD cbSize;HWND hWnd;UINT uCallbackMessage;UINT uEdge;ptr tagRECT;int lParam"
Local $tAPPBARAPPBARDATA = DllStructCreate($tagAPPBARAPPBARDATA)
Local $rc = "long left;long top; long right;long bottom"
Local $apirc = DllStructCreate($rc)
DllStructSetData($apirc, "left", 0)
DllStructSetData($apirc, "top", 0)
DllStructSetData($apirc, "right", $heghit)
DllStructSetData($apirc, "bottom", $d)
DllStructSetData($tagAPPBARAPPBARDATA,"tagRECT",DllStructGetPtr($apirc))
Local $hAPPBAR = WinGetHandle("[CLASS:Shell_TrayWnd]", "") ; Get handle of taskbar
DllStructSetData($tAPPBARAPPBARDATA, "hWnd", $hAPPBAR) ; Set handle to taskbar
DllStructSetData($tAPPBARAPPBARDATA, "cbSize", DllStructGetSize($tAPPBARAPPBARDATA)) ; Set size of struct
Local $Ret = DllCall("shell32.dll", "int", "SHAppBarMessage", "int", $Message, "ptr", DllStructGetPtr($tAPPBARAPPBARDATA))
If (@error) Or (Not $Ret[0]) Then
Return SetError(1, 0, 0)
EndIf
Local $Result[5]
$Result[0] = DllStructGetData($tAPPBARAPPBARDATA, 'uEdge')
$Result[1] = DllStructGetData($tAPPBARAPPBARDATA, 'Left')
$Result[2] = DllStructGetData($tAPPBARAPPBARDATA, 'Top')
$Result[3] = DllStructGetData($tAPPBARAPPBARDATA, 'Right')
$Result[4] = DllStructGetData($tAPPBARAPPBARDATA, 'Bottom')
Return $Result
EndFunc ;==>_WinAPI_ShellAppBarMessage
|