模拟一个双击事件出来。双击间隔为300毫秒
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $N = False,$T0,$T1,$I
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 422, 98, 193, 125)
$Input1 = GUICtrlCreateInput("Input1", 64, 32, 297, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$T0 = TimerInit()
While 1
$T1 = TimerDiff($T0)
if $T1>300 And $N=True Then
$N=False
$T0=TimerInit()
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYUP
lookmouse()
EndSwitch
WEnd
Func lookmouse()
If $N=False Then
$N = True
$T0 = TimerInit()
Else
$N = False
$i=$i+1
GUICtrlSetData($Input1, "产生双击,第"&$i&"次")
EndIf
EndFunc ;==>lookmouse
[ 本帖最后由 顽固不化 于 2008-7-23 12:55 编辑 ] |