Funktionreferenz


_GUIToolTip_GetBubbleSize

Beschreibung anzeigen in

Gibt die Breite und Höhe des Controls zurück

#include <GuiToolTip.au3>
_GUIToolTip_GetBubbleSize ( $hTool, $hWnd, $iID [, $iFlags = Default] )

Parameter

$hTool Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.)
$hWnd Handle zum Fenster, welches das Tool enthält
$iID Handle des Fensters welches mit dem Tool assoziiert ist oder die ID des Tools
$iFlags [optional] Flags welches die Darstellung des ToolTips regelt
    $TTF_IDISHWND = Zeigt an, dass $iID ist das Fenster Handle des Tools anstatt der ID
    $TTF_CENTERTIP = Zentriert das Fenster, zugehörig zu dem durch $iID festgelegten Tool
    $TTF_RTLREADING = Zeigt an, dass der Text in umgekehrter Richtung angezeigt werden soll
    $TTF_SUBCLASS = Zeigt an, dass das Control das Fenster des Tool unterklassifizieren soll
    $TTF_TRACK = Positioniert das Control neben dem zugehörigen Tool
    $TTF_ABSOLUTE = Positioniert das Fenster bei den gleichen Koordinaten wie TTM_TRACKPOSITION
    $TTF_TRANSPARENT = Sorgt dafür, dass das Control die Nachrichten an das Elternfenster weiterleitet
    $TTF_PARSELINKS = Zeigt an, dass links im Control Text ausgegliedert sein sollte
Standard = BitOr($TTF_SUBCLASS, $TTF_IDISHWND)

Die Konstanten sind in ToolTipConstants.au3 definiert.

Rückgabewert

Erfolg: die Breite des ToolTips im Low-Word und die Höhe im High-Word des Rückgabewertes.
Fehler: @error wird gesetzt (siehe Bemerkungen).

Bemerkungen

Wenn sich das von $hWnd referenzierte Steuerelement nicht im selben Prozess befindet und beide Prozesse in unterschiedlichen AutoIt-Modi (@AutoItVersion) ausgeführt werden, wird @error auf 6 gesetzt.

Diese Funktion arbeitet nur korrekt auf einem ToolTip welches Tracking aktiviert hat.
Wenn das Tracking nicht aktiviert ist werden falsche Werte zurückgegeben.

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUIToolTip_GetBubbleHeight, _GUIToolTip_GetBubbleWidth

Beispiel

Beispiel 1

#include "Extras\HelpFileInternals.au3"

#include <GUIConstantsEx.au3>
#include <GuiToolTip.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $hGUI = GUICreate("ToolTip Get Bubble Size/Height/Width v(" & @AutoItVersion & ")", 430, 300, 100, 100)

    ; create a tooltip control using default settings
    Local $hToolTip = _GUIToolTip_Create(0)
    _MemoSetHandleInProcess($hToolTip)

    Local $idButton = GUICtrlCreateButton("Button", 30, 32, 130, 28)
    Local $hButton = GUICtrlGetHandle($idButton)

;~  $hGUI = 0 ; is OK
    ; add a tool to the tooltip control
    _GUIToolTip_AddTool($hToolTip, $hGUI, "This is a ToolTip", $hButton)

    GUISetState(@SW_SHOW)

    ; Show the tooltip associated with the button
    Opt("MouseCoordMode", 2)
    MouseMove(50, 42, 0)
    Sleep(250)

    Local $iSize = _GUIToolTip_GetBubbleSize($hToolTip, $hGUI, $hButton)
    Local $iBubbleHeight = _GUIToolTip_GetBubbleHeight($hToolTip, $hGUI, $hButton)
    Local $iBubbleWidth = _GUIToolTip_GetBubbleWidth($hToolTip, $hGUI, $hButton)

    ; Display the height of the tooltip bubble in pixels
    _MemoMsgBox($MB_SYSTEMMODAL, "Information", "Bubble Size = " & @TAB & "0x" & Hex($iSize) & @CRLF & _
            "Bubble Height = " & @TAB & $iBubbleHeight & " " & " Pixels" & @CRLF & _
            "Bubble Width = " & @TAB & $iBubbleWidth & " Pixels")

    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd

    ; Destroy the tooltip control
    _MemoResetHandleInProcess($hTooltip)
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example

Example (OutProcess) : ToolTip Get Bubble Size to an External process

#include "Extras\HelpFileInternals.au3"

#include <GUIToolTip.au3>

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo, True) ; OK same mode, KO if different mode
    _MemoCreateOutProcess($hWin, "Button", 1, $sFromTo)

    Local $hToolTip = _MemoGetHandleInProcess()
    Local $hButton = _MemoCreateOutProcess($hWin, "Button", 0, $sFromTo)

    Local $iSize = _GUIToolTip_GetBubbleSize($hToolTip, $hWin, $hButton)
    Local $iBubbleHeight = _GUIToolTip_GetBubbleHeight($hToolTip, $hWin, $hButton)
    Local $iBubbleWidth = _GUIToolTip_GetBubbleWidth($hToolTip, $hWin, $hButton)
    If @error Then
        _MemoMsgBox($MB_ICONERROR, "Info" & $sFromTo, "_GUIToolTip_GetBubbleSize()" & " @error = " & @error & @CRLF & _
                @TAB & "cannot be enumerated from an external process" & @CRLF & _
                @TAB & "running in different mode")
    Else
        ; Display the height of the tooltip bubble in pixels
        _MemoMsgBox($MB_SYSTEMMODAL, "Information", "Bubble Size = " & @TAB & "0x" & Hex($iSize) & @CRLF & _
                "Bubble Height = " & @TAB & $iBubbleHeight & " " & " Pixels" & @CRLF & _
                "Bubble Width = " & @TAB & $iBubbleWidth & " Pixels")
    EndIf

    _MemoMsgBoxStatus("", Default, $hWin) ; no more action, wait GUI for closing, close also OutProcess GUI

EndFunc   ;==>Example