Function Reference


_GUIToolTip_EnumTools

Retrieves information about the current tool

#include <GuiToolTip.au3>
_GUIToolTip_EnumTools ( $hWnd, $iIndex )

Parameters

$hWnd Handle to the ToolTip control (returned by _GUIToolTip_Create.)
$iIndex 0-based index of the tool for which to retrieve information

Return Value

Returns an array with the following format:
    [0] - Comma separated string displaying TTF_ flags used
        TTF_IDISHWND = Indicates that $iID is the window handle to the tool instead of the ID
        TTF_CENTERTIP = Centers the window below the tool specified by $iID
        TTF_RTLREADING = Indicates that text will be displayed in the opposite direction
        TTF_SUBCLASS = Indicates that the control should subclass the tool's window to intercept messages
        TTF_TRACK = Positions the control next to the tool to which it corresponds
        TTF_ABSOLUTE = Positions the window at the same coordinates provided by TTM_TRACKPOSITION
        TTF_TRANSPARENT = Causes the control to forward mouse messages to the parent window
        TTF_PARSELINKS = Indicates that links in the control text should be parsed
    [1] - Handle to the window that contains the tool ($hWnd)
    [2] - Identifier of the tool ($iID)
    [3] - X coordinate of the upper left corner of the rectangle
    [4] - Y coordinate of the upper left corner of the rectangle
    [5] - X coordinate of the lower right corner of the rectangle
    [6] - Y coordinate of the lower right corner of the rectangle
    [7] - Handle to the instance that contains the string resource for the tool
    [8] - Text for the tool
    [9] - Application-defined value associated with the tool

Related

_GUIToolTip_GetCurrentTool, _GUIToolTip_GetToolInfo

Example

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

Example()

Func Example()
        Local $hGUI = GUICreate(StringTrimRight(@ScriptName, StringLen(".exe")), 350, 200)

        Local $idButton = GUICtrlCreateButton("This is a button", 30, 32, 130, 28)
        Local $hButton = GUICtrlGetHandle($idButton)
        ; create a tooltip control using default settings
        Local $hToolTip = _GUIToolTip_Create(0)

        ; add a tool to the tooltip control
        _GUIToolTip_AddTool($hToolTip, 0, "This is a ToolTip", $hButton)
        _GUIToolTip_AddTool($hToolTip, 0, "This is the GUI ToolTip", $hGUI)
        GUISetState(@SW_SHOW)
        ; GetToolCount returns 2, but tools are numbered starting from zero (0), so we have to subtract 1
        For $I = 0 To _GUIToolTip_GetToolCount($hToolTip) - 1
                Local $aTool = _GUIToolTip_EnumTools($hToolTip, $I)
                MsgBox($MB_SYSTEMMODAL, "Tooltip info for tooltip - " & $I, "Flags: " & @TAB & _GUIToolTip_BitsToTTF($aTool[0]) & @CRLF & _
                                "HWnd: " & @TAB & $aTool[1] & @CRLF & _
                                "ID: " & @TAB & $aTool[2] & @CRLF & _
                                "Left X:" & @TAB & $aTool[3] & @CRLF & _
                                "Left Y:" & @TAB & $aTool[4] & @CRLF & _
                                "Right X:" & @TAB & $aTool[5] & @CRLF & _
                                "Right Y:" & @TAB & $aTool[6] & @CRLF & _
                                "Instance:" & @TAB & $aTool[7] & @CRLF & _
                                "Text:" & @TAB & $aTool[8] & @CRLF & _
                                "lParam:" & @TAB & $aTool[9])
        Next

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