Hier mal der gesamte Code, die MsgBox, die anzeigt was man 2mal angeklickt hat, kann einfach gegen deine Funktion ausgetauscht werden, der Rest sollte sich von selbst erklären ;)
Ich hab außerdem noch ne kleine Extra-Funktion erstellt, die das alles noch ein wenig fehlerfreier macht
PHP Code:
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
AutoItSetOption ( "GuiOnEventMode" , 1 )
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 192, 124)
$List1 = GUICtrlCreateList("", 48, 16, 273, 305)
GUICtrlSetData ( $List1, "1|2|3|4|5|6" )
GUICtrlSetOnEvent ( $List1, "_DoubleClick" )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1=1
WEnd
Func _Exit ()
Exit
EndFunc
Func _MouseOverControl ()
Local $WindowPos, $ControlPos, $MousePos
Dim $WindowPos, $ControlPos, $MousePos
$WindowPos = WinGetPos ( @GUI_WinHandle )
$ControlPos = ControlGetPos ( @GUI_WinHandle, "", @GUI_CtrlId )
$MousePos = MouseGetPos ()
If $MousePos[0] > $WindowPos[0] + $ControlPos[0] And $MousePos[1] > $WindowPos[1] + $ControlPos[1] And $MousePos[0] < $WindowPos[0] + $ControlPos[0] + $ControlPos[2] And $MousePos[1] < $WindowPos[1] + $ControlPos[1] + $ControlPos[3] Then
Return True
Else
Return False
EndIf
EndFunc
Func _DoubleClick ( )
Local $controlID, $read, $timestamp, $dll, $executed
$controlID = @GUI_CtrlId
$read = GUICtrlRead ($controlID)
$dll = DllOpen ( "user32.dll" )
$timestamp = TimerInit()
$executed = False
Do
If _IsPressed ( "01", $dll ) And GUICtrlRead ( $controlID ) = $read And _MouseOverControl () Then
$executed = True
MsgBox ( 0, "", "Du hast " & $read & " zweimal angeklickt!")
EndIf
Until TimerDiff ( $timestamp ) > 750 Or $executed
DllClose ( $dll )
EndFunc