#NoTrayIcon
#include <GuiListView.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
DIM $_REG,$_REG_DP="DisplayName",$_REG_DI="DisplayIcon",$_REG_US="UninstallString",$X=0
DIM $_REG_String="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$GUI=GUICreate("添加删除程序",820,400,-1,-1)
$Label_01=GUICtrlCreateLabel("添加删除程序",10,20,800,40,0x01)
$Button_01=GUICtrlCreateButton("卸载",10,370,150,20)
$Button_02=GUICtrlCreateButton("退出",660,370,150,20)
$Lv=GUICtrlGetHandle(GUICtrlCreateListView("",10,50,800,315, BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS),$WS_EX_CLIENTEDGE))
_GUICtrlListView_SetExtendedListViewStyle($Lv,BitOR($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT,$LVS_EX_SUBITEMIMAGES,$LVS_EX_CHECKBOXES))
_GUICtrlListView_AddColumn($Lv, "", 40)
_GUICtrlListView_AddColumn($Lv, "列表",400)
_GUICtrlListView_AddColumn($Lv, "路径",355)
GUICtrlSetBkColor($Label_01, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($Button_01,"_Uninstall")
GUICtrlSetOnEvent($Button_02,"_EXIT")
GUISetOnEvent($GUI_EVENT_CLOSE,"_EXIT")
GUISetOnEvent($GUI_EVENT_MINIMIZE,"_MINIMIZE")
GUISetOnEvent($GUI_EVENT_RESTORE,"_RESTORE")
GUISetState()
for $i=1 to 1000
$_REG=RegEnumKey($_REG_String,$i)
If @error <> 0 then ExitLoop
if RegRead($_REG_String&$_REG,$_REG_DP)="" OR StringLeft($_REG,1)="{" Then
Else
_GUICtrlListView_AddItem($Lv,$x+1,$x)
_GUICtrlListView_AddSubItem($Lv,$x,RegRead($_REG_String&$_REG,$_REG_DP),1)
_GUICtrlListView_AddSubItem($Lv,$x,RegRead($_REG_String&$_REG,$_REG_US),2)
$x=$x+1
EndIf
Next
While 1
sleep(10)
WEnd
func _EXIT()
Exit
EndFunc
func _MINIMIZE()
GUISetState(@SW_MINIMIZE)
EndFunc
func _RESTORE()
GUISetState(@SW_RESTORE)
EndFunc
func _Uninstall()
$log = _GUICtrlListView_GetItemCount($Lv)
For $i = 0 To $log
If _GUICtrlListView_GetItemChecked($Lv, $i) = True Then
_GuiCtrlListView_SetItemselected($Lv, $i,True,True)
Run (_GUICtrlListView_AddSubItem($Lv,$x,RegRead($_REG_String&$_REG,$_REG_US),2))
Else
_GuiCtrlListView_SetItemselected($Lv, $i,False,,False)
EndIf
Next
EndFunc
运行后为什么不能同时选择多个checkbox去卸载?