本帖最后由 风行者 于 2012-3-22 06:06 编辑
刚好有空,写个刷新托盘工具栏的函数
#include <GUIToolbar.au3>
;例子=====================
ProcessClose("QQ.exe")
ProcessWaitClose("QQ.exe")
_ResTray()
;==========================
;刷新托盘函数
Func _ResTray()
;获取托盘工具栏句柄
$hTray = ControlGetHandle("[class:Shell_TrayWnd]", "", "ToolbarWindow321")
Local $iMode = Opt("MouseCoordMode", 1)
Local $aPos = MouseGetPos()
;鼠标移动到全部托盘图标
For $i = 0 To _GUICtrlToolbar_ButtonCount($hTray)
$tId = _GUICtrlToolbar_IndexToCommand($hTray, $i)
__Press_Button($hTray, $tId)
Next
MouseMove($aPos[0], $aPos[1], 0)
Opt("MouseCoordMode", $iMode)
EndFunc ;==>_ResTray
Func __Press_Button($hWnd, $iCommandID)
Local $tRect = _GUICtrlToolbar_GetButtonRectEx($hWnd, $iCommandID)
Local $tPoint = _WinAPI_PointFromRect($tRect)
$tPoint = _WinAPI_ClientToScreen($hWnd, $tPoint)
Local $iX, $iY
_WinAPI_GetXYFromPoint($tPoint, $iX, $iY)
MouseMove($iX, $iY, 0)
EndFunc ;==>__Press_Button
|