UDF > GUI > GuiToolTip >


_GUIToolTip_GetText

Obtient le texte d'un �l�ment d�clencheur

#include <GuiToolTip.au3>
_GUIToolTip_GetText ( $hWnd, $hTool, $iID )

Param�tres

$hWnd Handle du contr�le info-bulle (retourn� par _GUIToolTip_Create.)
$hTool Handle de la fen�tre qui contient l'�l�ment d�clencheur
$iID Identifiant de l'�l�ment, ou handle Window du contr�le auquel l'�l�ment est affect�

Valeur de retour

Retourne le texte de l'�l�ment sp�cifi�. Pour une info-bulle non cr��e avec AutoIt, la fonction ne r�cup�re que les 42 premiers caract�res du texte de l'�l�ment sp�cifi�.

En relation

_GUIToolTip_UpdateTipText

Exemple

Exemple 1

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

Example()

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

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

    Local $hToolTip = _GUIToolTip_Create($hGUI)

    _GUIToolTip_AddTool($hToolTip, 0, "Ceci est le texte de l'info-bulle", $hButton)

    GUISetState(@SW_SHOW)
    ; Obtient le texte de l'�l�ment bouton
    MsgBox($MB_SYSTEMMODAL, 'Message', _GUIToolTip_GetText($hToolTip, 0, $hButton))

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; D�truit le contr�le info-bulle
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example

Exemple 2

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

Global $g_iPID

; Hover over one of the characters in the Charmap app to get a tooltip to display, then press 'g' to
; retrieve its text information.
HotKeySet('g', "_Read_Tip")

Example()

Func Example()
    ; Run character map program
    $g_iPID = Run("charmap.exe")
    ; Wait for it to become the active window
    WinWaitActive("Character Map", "", 10)
    While ProcessExists($g_iPID)
        Sleep(100)
    WEnd
EndFunc   ;==>Example

Func _Read_Tip()
    ; Get list of tooltips
    Local $aTipList = WinList("[CLASS:tooltips_class32]")
    Local $aRet
    ; See which belong to your app
    For $i = 1 To $aTipList[0][0]
        If WinGetProcess($aTipList[$i][1]) = $g_iPID Then
            ; See which one is active
            $aRet = _GUIToolTip_GetCurrentTool($aTipList[$i][1])
            ; If one is active then display it
            If $aRet[8] <> "" Then MsgBox(0, "Visible Tip", $aRet[8])
        EndIf
    Next
EndFunc   ;==>_Read_Tip