楼主试试看这个@_@
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListView.au3>
Global Const $STN_DBLCLK = 2
$Form1 = GUICreate("Form1", 362, 269, 262, 158)
$Input1 = GUICtrlCreateInput("Input1", 8, 8, 137, 21)
$List1 = GUICtrlCreateList("", 160, 0, 193, 253)
GUICtrlSetData($List1, "a")
GUICtrlSetData($List1, "b")
GUICtrlSetData($List1, "12erwer23423112312312312")
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState(@SW_SHOW)
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
MsgBox(16,"警告","你丫的,还真的双击啊")
GUICtrlSetData($Input1,_GUICtrlListBox_GetText($List1,_GUICtrlListBox_GetCurSel($List1)),"")
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
|