本帖最后由 lynfr8 于 2011-3-13 23:00 编辑
回复 3# 阿米啦啦
确实,没认真测试就贴上来了
修改后:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $N = False, $T0, $T1, $I
$Form1 = GUICreate("双击Input控件示例.au3", 346, 64, 192, 124)
$Input = GUICtrlCreateInput("", 24, 16, 289, 21)
GUISetState(@SW_SHOW)
$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
$CursorInfo = GUIGetCursorInfo()
If $CursorInfo[4] = 3 Then
If $N = False Then
$N = True
$T0 = TimerInit()
Else
$N = False
$I = $I + 1
GUICtrlSetData($Input, "产生双击,第" & $I & "次")
EndIf
EndIf
EndSwitch
WEnd
|