#include <Date.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GUIListView.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Local $xun,$xunze,$daan,$xun2,$lujin,$tupian,$i,$w
$Form1 = GUICreate("Form1", 675, 408, 200, 147)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$ListView1 = GUICtrlCreateListView("测试点击", 32, 40, 113, 279)
$ListView2 = GUICtrlCreateListView("", 200, 40, 449, 273)
GUISetState(@SW_SHOW)
For $I = 1 To 10
GUICtrlCreateListViewItem($I, $ListView1)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ListView1 ;我想这里调用鼠标所点的那个数后打开窗口
GUISetState(@SW_HIDE,$Form1)
$Form2 = GUICreate("Form2", 488, 451, 192, 132)
$Button1 = GUICtrlCreateButton("OK", 108, 200, 181, 41)
GUISetState(@SW_SHOW)
While 1
$Msg_about = GUIGetMsg()
Select
Case $Msg_about = $gui_event_close Or $Msg_about = $Button1
GUIDelete($Form2) ;关闭窗口
GUISetState(@SW_SHOW,$Form1) ;显示主窗口
GUISetState(@SW_ENABLE, $Form1)
ExitLoop
EndSelect
WEnd
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $tNMTV, $iCode, $hItem
$tNMTV = DllStructCreate($tagNMTVDISPINFO, $ilParam)
$iCode = DllStructGetData($tNMTV, "Code")
$Index = _GUICtrlListView_GetSelectedIndices($ListView1)
If $iCode = $NM_DBLCLK And StringLen($Index) <> 0 Then MsgBox(0, 0, _GUICtrlListView_GetItemText($ListView1, Number($Index), 0))
If $iCode = $NM_RCLICK And StringLen($Index) <> 0 Then _GUICtrlListView_DeleteItem($ListView1, Number($Index))
EndFunc ;==>WM_NOTIFY