
;			"<ALT> + <S>" = Scriptkopf einfügen.

;			"<ALT> + <F>" = Funktionskopf einfügen.

;			"<ALT> + <I>" = Internen Funktionskopf einfügen.

;			"<ALT> + <T>" = AutoIt-Testdatei erzeugen.

#include <Misc.au3>
#include <WinAPIGdiInternals.au3>
#include <WinAPIMisc.au3>
#include <WinAPISysInternals.au3>
Global $dll = DllOpen("user32.dll")

; Den ToolTip anzeigen.
ToolTip(@CRLF & "Dies ist ein Test" & @CRLF & @CRLF & "Zum Ausblenden des ToolTips, auf den ToolTip klicken." & @CRLF & " ", _
        @DesktopWidth * 0.5, @DesktopHeight * 0.5, "ToolTip-Test", 2, 2)
While 1
    ; Sleep, um die Systemlast zu reduzieren.
    Sleep(100)
    ; Testen, ob die linke Maustaste betätigt wurde.
    If _IsPressed("01", $dll) Then
        ; Testen, ob der Mausklick innerhalb des Tooltips erfolgt ist.
        If _MouseInWindow() Then
            DllClose($dll)
            ToolTip("")
            ExitLoop
        EndIf
    EndIf
WEnd
DllClose($dll)
MsgBox(262144, "", "Ich habe fertig!")
Exit

Func _MouseInWindow()
    Local $hWnd = WinGetHandle('[CLASS:tooltips_class32]')
    Local $tRect = _WinAPI_GetWindowRect($hWnd)

	MsgBox(0, "Beispiel", _
        WinGetTitle($hWnd) & ":" & @CRLF & _
        DllStructGetData($tRect, "Left") & @CRLF & _ ; 1266 Daten ausgeben
        DllStructGetData($tRect, "Top") & @CRLF & _ ; 849
        DllStructGetData($tRect, "Right") & @CRLF & _ ; 1490
        DllStructGetData($tRect, "Bottom")) ; 873

    Local $tPoint = _WinAPI_GetMousePos()
	 MsgBox($MB_SYSTEMMODAL, "Mausposition: ", _
            "Bildschirmbezug: X = " & DllStructGetData($tPoint, "X") & "  Y = " & DllStructGetData($tPoint, "Y"))
; X: 1076, Y: 403
    Return _WinAPI_PtInRect($tRect, $tPoint)
EndFunc

