#include <GuiConstants.au3>
#include <WindowsConstants.au3>
$hSelection_GUI = GUICreate("", 400, 300, -1, -1);, _
;$WS_SIZEBOX + $WS_POPUP + 0x8, $WS_EX_DLGMODALFRAME + $WS_EX_DLGMODALFRAME + $WS_EX_CLIENTEDGE + $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
GUISetState()
Global $DBC = "", $mpos[2] = [0,0], $npos[2] = [1,1]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case -8 To -7 ;$WM_LBUTTONDBLCLK
;双击开始(不移动鼠标,点击2次)
If $mpos[0]=0 And $mpos[1]=0 Then
$mpos = MouseGetPos()
Else
$npos = MouseGetPos()
If $mpos[0]<>$npos[0] Or $mpos[1]<>$npos[1] Then
$DBC = ""
$mpos[0] = 0
$mpos[1] = 0
$npos[0] = 1
$npos[1] = 1
EndIf
EndIf
$DBC &= $nMsg
If $DBC = "-7-8-7-8" Then
MsgBox(0, 0, "双击")
ExitLoop
EndIf
;双击结束
EndSwitch
WEnd
|