#NoTrayIcon<br />
#include <GuiListView.au3><br />
#include <GuiConstantsEx.au3><br />
#include <WindowsConstants.au3><br />
<br />
Opt("GUIOnEventMode", 1)<br />
DIM $_REG,$_REG_DP="DisplayName",$_REG_DI="DisplayIcon",$_REG_US="UninstallString",$X=0<br />
DIM $_REG_String="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"<br />
<br />
$GUI=GUICreate("添加删除程序",820,400,-1,-1)<br />
$Label_01=GUICtrlCreateLabel("添加删除程序",10,20,800,40,0x01)<br />
$Button_01=GUICtrlCreateButton("卸载",10,370,150,20)<br />
$Button_02=GUICtrlCreateButton("退出",660,370,150,20)<br />
$Lv=GUICtrlGetHandle(GUICtrlCreateListView("",10,50,800,315, BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS),$WS_EX_CLIENTEDGE))<br />
_GUICtrlListView_SetExtendedListViewStyle($Lv,BitOR($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT,$LVS_EX_SUBITEMIMAGES))<br />
_GUICtrlListView_AddColumn($Lv, "", 20)<br />
_GUICtrlListView_AddColumn($Lv, "列表",400)<br />
_GUICtrlListView_AddColumn($Lv, "路径",355)<br />
<br />
<br />
GUICtrlSetBkColor($Label_01, $GUI_BKCOLOR_TRANSPARENT)<br />
GUICtrlSetOnEvent($Button_01,"_Uninstall")<br />
GUICtrlSetOnEvent($Button_02,"_EXIT")<br />
GUISetOnEvent($GUI_EVENT_CLOSE,"_EXIT")<br />
GUISetOnEvent($GUI_EVENT_MINIMIZE,"_MINIMIZE")<br />
GUISetOnEvent($GUI_EVENT_RESTORE,"_RESTORE")<br />
GUISetState()<br />
<br />
<br />
for $i=1 to 1000<br />
$_REG=RegEnumKey($_REG_String,$i)<br />
If @error <> 0 then ExitLoop<br />
if RegRead($_REG_String&$_REG,$_REG_DP)="" OR StringLeft($_REG,1)="{" Then<br />
Else<br />
_GUICtrlListView_AddItem($Lv,$x+1,$x)<br />
_GUICtrlListView_AddSubItem($Lv,$x,RegRead($_REG_String&$_REG,$_REG_DP),1)<br />
_GUICtrlListView_AddSubItem($Lv,$x,RegRead($_REG_String&$_REG,$_REG_US),2)<br />
$x=$x+1<br />
EndIf<br />
Next<br />
<br />
While 1<br />
sleep(10)<br />
WEnd<br />
<br />
func _EXIT()<br />
Exit<br />
EndFunc<br />
<br />
func _MINIMIZE()<br />
GUISetState(@SW_MINIMIZE)<br />
EndFunc<br />
<br />
func _RESTORE()<br />
GUISetState(@SW_RESTORE)<br />
EndFunc<br />
<br />
func _Uninstall()<br />
if _GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),2)="" then<br />
MsgBox(16,"添加删除程序","文件不存在 !")<br />
Else<br />
if MsgBox(1,"添加删除程序",_GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),1)&@CRLF&@CRLF&"您确定要卸载此程序?")=1 then Run(_GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),2))<br />
EndIf<br />
EndFunc
|