Ermittelt das Titel Bitmap Icon
#include <GuiToolTip.au3>
_GUIToolTip_GetTitleBitMap ( $hTool )
| $hTool | Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.) |
| Erfolg: | die Referenznummer des ToolTip-Titelsymbols. Siehe Bemerkungen. |
| Fehler: | setzt @error (siehe Bemerkungen). |
Wenn sich das von $hWnd referenzierte Steuerelement nicht im selben Prozess befindet und beide Prozesse in unterschiedlichen AutoIt-Modi (@AutoItVersion) ausgeführt werden, wird @error auf 6 gesetzt.
Die Referenznummer des Icons, welche von dieser Funktion zurückgegeben wird, ist mit den Icons verwandt um das Icon zu setzen.
Siehe dafür _GUIToolTip_SetTitle().
Wenn die Standard-Icons verwendet werden, so sind die Rückgabewerte wie folgt:
$TTI_NONE = 0
$TTI_INFO oder $TTI_INFO_LARGE = 1
$TTI_WARNING oder $TTI_WARNING_LARGE = 2
$TTI_ERROR oder $TTI_ERROR_LARGE = 3
Jegliches benutztes Icon welches nicht eins der oben genannten Icons ist, so wird eine 4 zurückgegeben welche angibt, dass ein HICON benutzt wurde.
- - - - - - - - Erklärung der Controls - - - - - - - -
#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
#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