Funktionreferenz


_WinAPI_ShellNotifyIconGetRect


Gets the screen coordinates of the bounding rectangle of a notification icon

#include <WinAPIShellEx.au3>
_WinAPI_ShellNotifyIconGetRect ( $hWnd, $iID [, $tGUID = 0] )

Parameter

$hWnd Handle to the parent window used by the notification's callback function. For more information,
see the "hWnd" member of the $tagNOTIFYICONDATA structure.
$iID Application-defined identifier of the notification icon. Multiple icons can be associated with a single
$hWnd, each with their own $iID.
$tGUID [optional] $tagGUID structure that identifies the icon.

Rückgabewert

Success: $tagRECT structure that contains the coordinates of the icon.
Failure: Sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

Bemerkungen

The icon can be identified through $hWnd plus $iID, or $tGUID alone (recommended).

This function requires Windows 7 or later.

Siehe auch

Suche nach Shell_NotifyIconGetRect in der MSDN Bibliothek.

Beispiel

#include <MsgBoxConstants.au3>
#include <WinAPIGdi.au3>
#include <WinAPIShellEx.au3>
#include <WinAPISys.au3>

If Number(_WinAPI_GetVersion()) < 6.1 Then
    MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Fehler', 'Benötigt Windows 7 oder neuer.')
    Exit
EndIf

Local $tRECT = _WinAPI_ShellNotifyIconGetRect(WinGetHandle(AutoItWinGetTitle()), 1)

Local $Pos
If Not @error Then
    $Pos = _WinAPI_GetPosFromRect($tRECT)
    MouseMove($Pos[0] + 12, $Pos[1] + 12)
    MouseClick('left')
    While 1
        Sleep(1000)
    WEnd
EndIf