Returns the width of a ToolTip control
#include <GuiToolTip.au3>
_GUIToolTip_GetBubbleWidth ( $hWnd, $hTool, $iID [, $iFlags = 0x00000001 + 0x00000010] )
$hWnd | Handle to the ToolTip control (returned by _GUIToolTip_Create.) |
$hTool | Handle to the window that contains the tool |
$iID | Handle of the control that the tool is associated with, or the ID of the tool |
$iFlags | [optional] Flags that control the ToolTip display $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 |
This function works correctly only on a tracking tooltip, if the tracking hasn't been activated for the tooltip you will get incorrect values returned.
_GUIToolTip_GetBubbleHeight, _GUIToolTip_GetBubbleSize
#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_TrackActivate($hToolTip, True, 0, $hButton)
GUISetState(@SW_SHOW)
; Display the height of the tooltip bubble in pixels
MsgBox($MB_SYSTEMMODAL, "Info", "Bubble Width = " & _GUIToolTip_GetBubbleWidth($hToolTip, 0, $hButton) & " Pixels")
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
; Destroy the tooltip control
_GUIToolTip_Destroy($hToolTip)
GUIDelete($hGUI)
EndFunc ;==>Example