Obtient le texte d'info-bulle pour une partie sp�cifi�e
#include <GuiStatusBar.au3>
_GUICtrlStatusBar_GetTipText ( $hWnd, $iPart )
$hWnd | Handle du contr�le StatusBar |
$iPart | Index de base 0, de la partie |
La barre d'�tat doit �tre cr�� avec le style $SBARS_TOOLTIPS pour permettre les info-bulles.
#include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WinAPIIcons.au3> #include <WindowsConstants.au3> Global $g_idMemo Example() Func Example() Local $hGUI, $hIcon, $hStatus Local $aParts[4] = [75, 150, 300, 400] ; Cr�e une GUI $hGUI = GUICreate("(Example 1) StatusBar Get Tip Text", 400, 300) $hStatus = _GUICtrlStatusBar_Create($hGUI, -1, "", $SBARS_TOOLTIPS) ; Cr�e un contr�le memo $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) ; D�finit des parties _GUICtrlStatusBar_SetParts($hStatus, $aParts) _GUICtrlStatusBar_SetText($hStatus, "Force tip to be shown when text is more than fits in the box", 1) ; D�finit une ic�ne $hIcon = _WinAPI_LoadShell32Icon(23) _GUICtrlStatusBar_SetIcon($hStatus, 0, $hIcon) ; D�finit le texte des ToolTips _GUICtrlStatusBar_SetTipText($hStatus, 0, "Tip works when only icon in part or text exceeds part") _GUICtrlStatusBar_SetTipText($hStatus, 1, "Force tip to be shown when text is more than fits in the box") MemoWrite("Hold Mouse Cursor over part to see tip." & @CRLF) ; Affiche le texte des Tolltip MemoWrite("Text tip 1 .: " & _GUICtrlStatusBar_GetTipText($hStatus, 0) & @CRLF) MemoWrite("Text tip 2 .: " & _GUICtrlStatusBar_GetTipText($hStatus, 1)) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Lib�re les ic�nes _WinAPI_DestroyIcon($hIcon) GUIDelete() EndFunc ;==>Example ; Ecrit un message dans le contr�le memo Func MemoWrite($sMessage = "") GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
#include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> Global $g_idMemo Example() Func Example() Local $hGUI, $hStatus Local $aParts[4] = [75, 150, 300, 400] ; Cr�e une GUI $hGUI = GUICreate("(Example 2) StatusBar Get Tip Text", 400, 300) $hStatus = _GUICtrlStatusBar_Create($hGUI, -1, "", $SBARS_TOOLTIPS) ; Cr�e un contr�le memo $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) ; D�finit des parties _GUICtrlStatusBar_SetParts($hStatus, $aParts) _GUICtrlStatusBar_SetText($hStatus, "Force tip to be shown when text is more than fits in the box", 1) ; D�finit une ic�ne _GUICtrlStatusBar_SetIcon($hStatus, 0, 23, "shell32.dll") ; D�finit le texte des Tooltip _GUICtrlStatusBar_SetTipText($hStatus, 0, "Tip works when only icon in part or text exceeds part") _GUICtrlStatusBar_SetTipText($hStatus, 1, "Force tip to be shown when text is more than fits in the box") MemoWrite("Hold Mouse Cursor over part to see tip." & @CRLF) ; Affiche le texte des Tooltip MemoWrite("Text tip 1 .: " & _GUICtrlStatusBar_GetTipText($hStatus, 0) & @CRLF) MemoWrite("Text tip 2 .: " & _GUICtrlStatusBar_GetTipText($hStatus, 1)) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example ; Ecrit un message dans le contr�le memo Func MemoWrite($sMessage = "") GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite