Hi hipfzwirgel , hi Schnuffel 👋 ,
deine "stumpfe" Variante funktioniert wunderbar Schnuffel .
Sie hat nur die kleine Einschränkung, dass während der 10 Sekunden die GUI nicht verwendbar ist.
Also eine Interaktion mit dem Button (ich nehme an da kommen noch mehr dazu) nicht möglich ist, da ja das Skript durch das Sleep() blockiert ist.
Daher habe ich mit deinen Werten aus WinGetPos() und ControlGetPos() eine Variante mit einem Timer gebastelt.
Somit kann während der Anzeige auch noch die GUI "bedient" werden, falls dies gewünscht ist. Wenn nicht, dann bitte Variante 1 nutzen 😅 .
AutoIt
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#include-once
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>
_Main()
Func _Main()
Local $hGUI = GUICreate('My GUI list')
Local $cList = GUICtrlCreateList('', 64, 32, 121, 97, BitOR($WS_VSCROLL, $LBS_USETABSTOPS))
GUICtrlSetLimit(-1, 200) ; To limit horizontal scrolling.
GUICtrlSetData(-1, '||1. Item')
Local $idClose = GUICtrlCreateButton('my closing button', 64, 160, 175, 25)
GUISetState(@SW_SHOW)
Local $mGui[]
$mGui.Data = WinGetPos($hGUI)
$mGui.XPos = $mGui.Data[0]
$mGui.YPos = $mGui.Data[1]
Local $mListControl[]
$mListControl.Data = ControlGetPos('', '', $cList)
$mListControl.XPos = $mListControl.Data[0]
$mListControl.YPos = $mListControl.Data[1]
$mListControl.Height = $mListControl.Data[3]
Local $mToolTip[]
$mToolTip.XPos = $mGui.XPos + $mListControl.XPos + 48
$mToolTip.YPos = $mGui.YPos + $mListControl.YPos + $mListControl.Height - 48
ToolTip('Beispieltext', $mToolTip.XPos, $mToolTip.YPos, 'INFO', 1, 1)
Local Const $iSecondsToWait = 5 * 1000
Local $bShouldBallonTipBeDisplayed = True
Local $hTimer = TimerInit()
While True
If $bShouldBallonTipBeDisplayed Then
If TimerDiff($hTimer) >= $iSecondsToWait Then
ToolTip('')
$bShouldBallonTipBeDisplayed = False
EndIf
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idClose
MsgBox('', '', 'the closing button has been clicked', 2)
ExitLoop
EndSwitch
WEnd
GUIDelete($hGUI)
EndFunc
Alles anzeigen
Einen angenehmen Abend euch noch 🤝 .
Viele Grüße
Sven