Funktionreferenz


_GUIToolTip_Destroy

Beschreibung anzeigen in

Löscht ein ToolTip-Control

#include <GuiToolTip.au3>
_GUIToolTip_Destroy ( ByRef $hTool )

Parameter

$hTool Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.)

Rückgabewert

Erfolg: True, das Handle $hWnd wird auf 0 gesetzt
Fehler: False, und setzt @error
        1 - Es ist nicht gestattet die Controls fremder Anwendungen zu löschen
        2 - $hWnd ist kein ToolTip-Control Handle.

Bemerkungen

Funktioniert nur mit ToolTip-Controls, die mit _GUIToolTip_Create erstellt wurden.

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

Verwandte Funktionen

_GUIToolTip_Create

Beispiel

Beispiel 1

#include "Extras\HelpFileInternals.au3"

#include <GUIConstantsEx.au3>
#include <GuiToolTip.au3>

; Click the button to destroy the tooltip control
Example()

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

    ; create a tooltip control using default settings
    Local $hToolTip = _GUIToolTip_Create(0)
    _MemoSetHandleInProcess($hToolTip)

    Local $idButton = GUICtrlCreateButton("Click to Destroy", 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 a ToolTip", $hButton)
    _GUIToolTip_AddTool($hToolTip, $hGUI, "ToolTip text for the GUI", $hGUI)

    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton
                ; Destroys the tooltip control
                _GUIToolTip_Destroy($hToolTip)
                _MemoMsgBox($MB_SYSTEMMODAL, "Tool count", "Number of tools:" & @TAB & _GUIToolTip_GetToolCount($hToolTip))
        EndSwitch
    WEnd

    ; Destroy the tooltip control (in case the button hasn't been actioned yet)
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example

Example (OutProcess) : ToolTip Destroy to an External process

#include "Extras\HelpFileInternals.au3"

#include <GUIToolTip.au3>

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo, True)
    _MemoCreateOutProcess($hWin, "Button", 0, $sFromTo)

    Local $hToolTip = _MemoGetHandleInProcess()
    _GUIToolTip_Destroy($hToolTip)
    If @error Then
        _MemoMsgBox($MB_ICONERROR, "Info" & $sFromTo, "_GUIToolTip_Destroy()" & " @error = " & @error & @CRLF & _
                @TAB & "cannot be distroyed in an external process")
    Else
        ; should not occur
        _MemoWrite(">>> _GUIToolTip_GetToolCount() = " & _GUIToolTip_GetToolCount($hToolTip))
        ; GetToolCount returns 1, but tools are numbered starting from zero (0), so we have to subtract 1
        For $I = 0 To _GUIToolTip_GetToolCount($hToolTip) - 1
            Local $aTool = _GUIToolTip_EnumTools($hToolTip, $I)
            ; only working if both processes are running in "same mode"
            _MemoWrite(">>> Tooltip info for tooltip - " & $I & @CRLF & _
                    "Flags: " & @TAB & _GUIToolTip_BitsToTTF($aTool[0]) & @CRLF & _
                    "HWnd: " & @TAB & "0x" & Hex($aTool[1]) & @CRLF & _
                    "ID: " & @TAB & "0x" & Hex($aTool[2]) & @CRLF & _
                    "Left X:" & @TAB & $aTool[3] & @CRLF & _
                    "Left Y:" & @TAB & $aTool[4] & @CRLF & _
                    "Right X:" & @TAB & $aTool[5] & @CRLF & _
                    "Right Y:" & @TAB & $aTool[6] & @CRLF & _
                    "Instance:" & @TAB & $aTool[7] & @CRLF & _
                    "Text:" & @TAB & $aTool[8] & @CRLF & _
                    "lParam:" & @TAB & $aTool[9])
        Next
    EndIf

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

EndFunc   ;==>Example