发现MM,当然得帮咯
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WindowsConstants.au3>
Global Const $STN_DBLCLK = 2
Global Const $STN_SIGCLK = 1
$Form1 = GUICreate("Form1", 362, 269, 262, 158)
$Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 50)
$List1 = GUICtrlCreateList("", 160, 0, 193, 253)
GUICtrlSetData($List1, "123")
GUICtrlSetData($List1, "345")
GUICtrlSetData($List1, "789")
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
Local $nNotifyCode = BitShift($wParam,16)
Local $nID = BitAND($wParam, 0xFFFF)
Local $hCtrl = $lParam
Switch $nID
Case $List1
Switch $nNotifyCode
Case $STN_DBLCLK
ondblclick()
Case $STN_SIGCLK
onclick()
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Func ondblclick()
Assign("isdblclick", True, 2)
; 下面放需要执行的东东
GUICtrlSetData($Input1 , GUICtrlRead($List1))
EndFunc
Func onclick($call = 1)
If IsDeclared("call") Then Return AdlibRegister("onclick",100)
Local $dblclick = Eval("isdblclick")
Assign("isdblclick", False, 2)
AdlibUnRegister("onclick")
; 如果是双击,则不操作,返回
If $dblclick Then Return
; 下面放需要执行的东东
GUICtrlSetData($Input1,"我只想单击时显示本段文字,双击时别闪现本段文字,怎么弄哦")
EndFunc
|