Function Reference


_GUIToolTip_GetTitleBitMap

Retrieves the title bitmap icon

#include <GuiToolTip.au3>
_GUIToolTip_GetTitleBitMap ( $hTool )

Parameters

$hTool Handle to the ToolTip control (returned by _GUIToolTip_Create.)

Return Value

Success: the reference number of the ToolTip title icon. See remarks
Failure: set @error (see remark).

Remarks

If $hWnd referenced control is not in the same process and both processes run in different AutoIt mode (@AutoItVersion), the @error is set to 6.

The icon reference number returned by this function is related to the icons used to set the title icon, see _GUIToolTip_SetTitle().
If using the standard icons, the return values will be
        $TTI_NONE = 0
        $TTI_INFO or $TTI_INFO_LARGE = 1
        $TTI_WARNING or $TTI_WARNING_LARGE = 2
        $TTI_ERROR or $TTI_ERROR_LARGE = 3
Any icon used that isn't one of these will return 4 signifying an HICON was used.

Related

_GUIToolTip_SetTitle

Example

Example 1

#include "Extras\HelpFileInternals.au3"

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

Example()

Func Example()
    Local $hGUI = GUICreate("ToolTip Get Title BitMap v(" & @AutoItVersion & ")", 450, 300, 100, 100)

    ; Create a tooltip control
    Local $hToolTip = _GUIToolTip_Create(0)
    _MemoSetHandleInProcess($hToolTip)

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

;~  $hGUI = 0 ; is OK
    ; Add a tool to the tooltip control
    _GUIToolTip_AddTool($hToolTip, $hGUI, "This is the ToolTip text", $hButton)

    Local $hIcon = _WinAPI_LoadShell32Icon(15)

    ; Set the title of the tooltip
    _GUIToolTip_SetTitle($hToolTip, 'This is the Title Text', $hIcon)

    GUISetState(@SW_SHOW)

    ; Show the tooltip associated with the button
    Opt("MouseCoordMode", 2)
    MouseMove(50, 42, 0)
    Sleep(250)

    _MemoMsgBox($MB_SYSTEMMODAL, "Title Bitmap", _GUIToolTip_GetTitleBitMap($hToolTip))

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton
                _MemoMsgBox($MB_SYSTEMMODAL, "Title Bitmap", _GUIToolTip_GetTitleBitMap($hToolTip) & @CRLF & $hToolTip)
        EndSwitch
    WEnd

    ; Destroy the tooltip control
    _MemoResetHandleInProcess($hTooltip)
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example

Example (OutProcess) : ToolTip Get TitleBitMap from an External process

#include "Extras\HelpFileInternals.au3"

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

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo, True) ; OK same mode, KO if different mode
    Local $hButton = _MemoCreateOutProcess($hWin, "Button", 1, $sFromTo)

    Local $hToolTip = _MemoGetHandleInProcess()

    ; Set the title of the tooltip
    _GUIToolTip_SetTitle($hToolTip, '>>>New Title Text', $TTI_WARNING)
    If @error Then
        _MemoMsgBox($MB_ICONERROR, "Info" & $sFromTo, "_GUIToolTip_SetTitle()" & " @error = " & @error & @CRLF & _
                "cannot be Set by an external process")
    Else
        _GUIToolTip_TrackActivate($hToolTip, True, $hWin, $hButton)
        Local $iTitleBitMap = _GUIToolTip_GetTitleBitMap($hToolTip)
        If @error Then
            _MemoMsgBox($MB_ICONERROR, "Info" & $sFromTo, "_GUIToolTip_GetTitleBitMap()" & " @error = " & @error & @CRLF & _
                    @TAB & "cannot be retrieved from an external process" & @CRLF & _
                    @TAB & "running in different mode")
        Else
            ; only working if both processes are running in "same mode"
            _MemoWrite(">>> Title Bitmap" & $sFromTo & " = " & $iTitleBitMap)
        EndIf
    EndIf

    _MemoMsgBoxStatus("", Default, $hWin) ; no more action, wait GUI for closing, close also OutProcess GUI

EndFunc   ;==>Example