Supprime de l'écran une info-bulle affichée
#include <GuiToolTip.au3>
_GUIToolTip_Pop ( $hWnd )
$hWnd | Handle du contrôle info-bulle (retourné par _GUIToolTip_Create.) |
#include <GUIConstantsEx.au3> #include <GUIToolTip.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, $TTS_BALLOON) Local $aPos = MouseGetPos() _GUIToolTip_AddTool($hToolTip, 0, " ", 0, 0, 0, 0, 0, 0) _GUIToolTip_SetTitle($hToolTip, 'Coordonnées de la souris: ', $TTI_INFO) GUISetState(@SW_SHOW) ; Cherche la position de la souris pour l'utiliser comme point de départ pour le tracking _GUIToolTip_TrackPosition($hToolTip, $aPos[0], $aPos[1]) _GUIToolTip_TrackActivate($hToolTip, True, 0, 0) Local $hTimer = TimerInit() Local $iMsg Do ; Obtient la position de la souris $aPos = MouseGetPos() ; Utilise la position de la souris pour définir la position de l'info-bulle _GUIToolTip_TrackPosition($hToolTip, $aPos[0], $aPos[1]) _GUIToolTip_UpdateTipText($hToolTip, 0, 0, "X: " & $aPos[0] & " Y: " & $aPos[1]) $iMsg = GUIGetMsg() If $iMsg <> $GUI_EVENT_CLOSE Then If $iMsg = $idButton Then ; ... EndIf ; 3 secondes après le début, enlève l'élément de l'affichage If TimerDiff($hTimer) >= 3000 Then _GUIToolTip_Pop($hToolTip) EndIf EndIf Until $iMsg = $GUI_EVENT_CLOSE ; Détruit le contrôle info-bulle _GUIToolTip_Destroy($hToolTip) GUIDelete($hGUI) EndFunc ;==>Example