#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
Global $TabSheet[6], $ListView[6], $Button[11], $youjian[6], $shuaxin[6]
Global $Form1
_maingui()
Func _maingui()
Local $Form1 = GUICreate("Form1", 683, 516, 365, 125)
Local $Tab1 = GUICtrlCreateTab(16, 64, 649, 393)
Local $Label1 = GUICtrlCreateLabel("Label1", 200, 16, 244, 33)
_duanxin()
_wenhou()
_jingdian()
_anlie()
_dengdeng()
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
_GUICloseEvent()
EndFunc ;==>_maingui
Func _duanxin()
$TabSheet[1] = GUICtrlCreateTabItem("短信")
$ListView[1] = GUICtrlCreateListView("序号|文章", 24, 88, 634, 302, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Button[1] = GUICtrlCreateButton("添加", 144, 408, 75, 25)
$Button[2] = GUICtrlCreateButton("生成", 432, 408, 75, 25)
Local $aFileList = _FileListToArray("D:\短信", "*")
Local $iRows = UBound($aFileList)
For $i = 1 To $iRows - 1 Step 1
Local $idItem = GUICtrlCreateListViewItem($i & "|" & $aFileList[$i], $ListView[1])
Next
EndFunc ;==>_duanxin
Func _wenhou()
$TabSheet[2] = GUICtrlCreateTabItem("问候")
$ListView[2] = GUICtrlCreateListView("序号|文章", 24, 88, 634, 302, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Button[3] = GUICtrlCreateButton("添加", 96, 408, 75, 25)
$Button[4] = GUICtrlCreateButton("生成", 472, 408, 75, 25)
Local $aFileList = _FileListToArray("D:\问候", "*")
Local $iRows = UBound($aFileList)
For $i = 1 To $iRows - 1 Step 1
Local $idItem = GUICtrlCreateListViewItem($i & "|" & $aFileList[$i], $ListView[2])
Next
EndFunc ;==>_wenhou
Func _jingdian()
$TabSheet[3] = GUICtrlCreateTabItem("经典")
$ListView[3] = GUICtrlCreateListView("序号|文章", 24, 88, 634, 302, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Button[5] = GUICtrlCreateButton("添加", 112, 416, 75, 25)
$Button[6] = GUICtrlCreateButton("生成", 416, 416, 75, 25)
Local $aFileList = _FileListToArray("D:\经典", "*")
Local $iRows = UBound($aFileList)
For $i = 1 To $iRows - 1 Step 1
Local $idItem = GUICtrlCreateListViewItem($i & "|" & $aFileList[$i], $ListView[3])
Next
EndFunc ;==>_jingdian
Func _anlie()
$TabSheet[4] = GUICtrlCreateTabItem("案例")
$ListView[4] = GUICtrlCreateListView("序号|文章", 24, 88, 634, 302, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Button[7] = GUICtrlCreateButton("添加", 128, 408, 75, 25)
$Button[8] = GUICtrlCreateButton("生成", 384, 416, 75, 25)
Local $aFileList = _FileListToArray("D:\案例", "*")
Local $iRows = UBound($aFileList)
For $i = 1 To $iRows - 1 Step 1
Local $idItem = GUICtrlCreateListViewItem($i & "|" & $aFileList[$i], $ListView[4])
Next
EndFunc ;==>_anlie
Func _dengdeng()
$TabSheet[5] = GUICtrlCreateTabItem("等等")
$ListView[5] = GUICtrlCreateListView("序号|文章", 24, 88, 634, 302, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$Button[9] = GUICtrlCreateButton("添加", 176, 416, 75, 25)
$Button[10] = GUICtrlCreateButton("生成", 432, 416, 75, 25)
Local $aFileList = _FileListToArray("D:\等等", "*")
Local $iRows = UBound($aFileList)
For $i = 1 To $iRows - 1 Step 1
Local $idItem = GUICtrlCreateListViewItem($i & "|" & $aFileList[$i], $ListView[5])
Next
EndFunc ;==>_dengdeng
Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) ;鼠标左键右键双击
Local $tagNMHDR, $Event, $hWndFrom, $IDFrom
Local $tagNMHDR = DllStructCreate("int;int;int", $lParam)
If @error Then Return $GUI_RUNDEFMSG
$IDFrom = DllStructGetData($tagNMHDR, 2)
$Event = DllStructGetData($tagNMHDR, 3)
$tagNMHDR = 0
Switch $IDFrom;选择产生事件的控件
Case $ListView[1]
Switch $Event; 选择产生的事件
Case $NM_CLICK ; 左击
Case $NM_DBLCLK ;双击
;~ MsgBox(0,0,"你双击了")
Case $NM_RCLICK ; 右击
GUICtrlDelete($youjian[1])
$youjian[1] = GUICtrlCreateContextMenu($ListView[1])
$shuaxin[1] = GUICtrlCreateMenuItem("刷新", $youjian[1])
EndSwitch
Case $ListView[2]
Switch $Event
Case $NM_RCLICK
GUICtrlDelete($youjian[2])
$youjian[2] = GUICtrlCreateContextMenu($ListView[2])
$shuaxin[2] = GUICtrlCreateMenuItem("刷新", $youjian[2])
EndSwitch
;~
EndSwitch
EndFunc ;==>WM_NOTIFY
Func _GUICloseEvent()
Local $aMsg = 0
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[1]
Case $Form1
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Exit
Case $Button[1]
MsgBox(0, 0, "1")
Case $Button[2]
MsgBox(0, 0, "2")
Case $Button[3]
MsgBox(0, 0, "3")
Case $Button[4]
MsgBox(0, 0, "4")
Case $Button[5]
MsgBox(0, 0, "5")
Case $Button[6]
MsgBox(0, 0, "6")
Case $Button[7]
MsgBox(0, 0, "7")
Case $Button[8]
MsgBox(0, 0, "8")
Case $Button[9]
MsgBox(0, 0, "9")
Case $Button[10]
MsgBox(0, 0, "10")
EndSwitch
EndSwitch
WEnd
EndFunc ;==>_GUICloseEvent
求帮助,求解答,求思路。谢谢。非常感谢