Obtient des informations sur l'�l�ment d�clencheur en cours
#include <GuiToolTip.au3>
_GUIToolTip_GetCurrentTool ( $hWnd )
$hWnd | Handle du contr�le info-bulle (retourn� par _GUIToolTip_Create.) |
L'info-bulle doit �tre affich�e lorsque cette fonction est appel�e ou les r�sultats retourn�s seront tous des z�ros.
_GUIToolTip_EnumTools, _GUIToolTip_GetToolInfo
#include <GUIConstantsEx.au3> #include <GUIToolTip.au3> #include <MsgBoxConstants.au3> Global $g_hToolTip ; Survolez le bouton sur la GUI et appuyez sur la touche "g" pour afficher les informations HotKeySet("g", "Get_Tool") Example() Func Example() Local $hGUI = GUICreate(StringTrimRight(@ScriptName, StringLen(".exe")), 350, 200) Local $idButton = GUICtrlCreateButton("Button ToolTip", 30, 32, 130, 28) Local $hButton = GUICtrlGetHandle($idButton) ; Cr�e un contr�le info-bulle avec les param�tres par d�faut $g_hToolTip = _GUIToolTip_Create(0) ; Ajoute un �l�ment au contr�le info-bulle _GUIToolTip_AddTool($g_hToolTip, 0, "This is a ToolTip", $hButton) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; D�truit le contr�le info-bulle _GUIToolTip_Destroy($g_hToolTip) GUIDelete($hGUI) EndFunc ;==>Example Func Get_Tool() Local $aTool = _GUIToolTip_GetCurrentTool($g_hToolTip) MsgBox($MB_SYSTEMMODAL, "Tooltip info", "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]) EndFunc ;==>Get_Tool
#include <GUIConstantsEx.au3> #include <GUIToolTip.au3> #include <MsgBoxConstants.au3> Global $g_iPID ; Survolez l'un des caract�res dans l'application Table des caract�res de Windows pour obtenir une info-bulle � afficher, ; puis appuyez sur 'g' pour r�cup�rer ses informations. HotKeySet('g', "_Read_Tip") Example() Func Example() ; Ex�cute le programme Table des caract�res $g_iPID = Run("charmap.exe") ; Attend que la fen�tre soit active WinWaitActive("Character Map", "", 10) While ProcessExists($g_iPID) Sleep(100) WEnd EndFunc ;==>Example Func _Read_Tip() ; Obtient la liste des �l�ments d�clencheurs Local $aTipList = WinList("[CLASS:tooltips_class32]") ; Regarde qui appartient � l'application For $i = 1 To $aTipList[0][0] If WinGetProcess($aTipList[$i][1]) = $g_iPID Then ; Regarde lequel est actif _GUIToolTip_GetCurrentTool($aTipList[$i][1]) ; Si un est actif alors l'affiche Local $aTool = _GUIToolTip_GetCurrentTool($aTipList[$i][1]) MsgBox($MB_SYSTEMMODAL, "Tooltip info", "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]) EndIf Next EndFunc ;==>_Read_Tip