Funktionreferenz


_GUIToolTip_SetTitle

Beschreibung anzeigen in

Fügt ein Standardicon und ein Titelstring hinzu

#include <GuiToolTip.au3>
_GUIToolTip_SetTitle ( $hTool, $sTitle [, $iIcon = 0] )

Parameter

$hTool Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.)
$sTitle Titelstring
$iIcon [optional] Setzt einen der unteren Werte:
    $TTI_NONE (0) - Kein Icon [Standard]
    $TTI_INFO (1) - Informationsicon
    $TTI_WARNING (2) - Warnungsicon
    $TTI_ERROR (3) - Erroricon
    $TTI_INFO_LARGE (4) - Großes Informationsicon
    $TTI_WARNING_LARGE (5) - Großes Warnungsicon
    $TTI_ERROR_LARGE (6) - Großes Erroricon

Rückgabewert

Erfolg: True.
Fehler: False.

Bemerkungen

Bei Windows XP SP2 und neuer, kann $iIcon einen HICON Wert enthalten. Jeder Wert größer als 3 wird als HICON angesehen.
Der Titel eines Tooltips taucht in einer anderen Schriftart über dem Text des Tooltips auf.
Es reicht nicht nur den Titel eines Tooltips anzugeben, da ein Tooltip nur angezeigt wird wenn ein Titel und Text angegeben wird.
Ein Titel mit einem Icon aber ohne Text im Titel wird weder Titel noch Icon anzeigen.
Selbst wenn man nur ein Icon anzeigen möchte, so muss man dennoch mindestens einen Buchstaben angeben.
Der String der in $sTitle enthalten ist darf nicht länger als 99 Zeichen sein.

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUIToolTip_GetTitleText, _GUIToolTip_UpdateTipText

Beispiel

Beispiel 1

#include "Extras\HelpFileInternals.au3"

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

Example()

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

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

    _MemoCreate(4, 68, 444, 196)

    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)

    ; Set the title of the tooltip
    _GUIToolTip_SetTitle($hToolTip, 'This is the ToolTip title', $TTI_INFO)

    GUISetState(@SW_SHOW)

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

    _MemoMsgBox($MB_SYSTEMMODAL, "ToolTip Title =", _GUIToolTip_GetTitleText($hToolTip))
    _MemoMsgBox($MB_SYSTEMMODAL, "Tooltip Text =", _GUIToolTip_GetText($hToolTip, $hGUI, $hButton))

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

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

Example 2 : ToolTip Set Title to an External process

#include "Extras\HelpFileInternals.au3"

#include <GUIToolTip.au3>

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo) ; OK also in "same mode"
    _MemoCreateOutProcess($hWin, "Button", 2, $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 & _
                @TAB & "cannot be accessed from an external process" & @CRLF & _
                @TAB & "running in different mode")
    Else
        _MemoMsgBox($MB_SYSTEMMODAL, "ToolTip Title" & $sFromTo, _GUIToolTip_GetTitleText($hToolTip))
    EndIf

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

EndFunc   ;==>Example