#NoTrayIcon
#include
#include
#include
Opt("GUIOnEventMode", 1)
DIM $_REG,$_REG_DP="DisplayName",$_REG_DI="DisplayIcon",$_REG_US="UninstallString",$X=0
DIM $_REG_String="HKEY_LOCAL_MACHINE\ ...
techbytnt 发表于 2009-4-7 12:21
整理一下:#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))
_GUICtrlListView_AddColumn($Lv, "", 20)
_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()
if _GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),2)="" then
MsgBox(16,"添加删除程序","文件不存在 !")
Else
if MsgBox(1,"添加删除程序",_GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),1)&@CRLF&@CRLF&"您确定要卸载此程序?")=1 then Run(_GUICtrlListView_GetItemText($LV,_GUICtrlListView_GetSelectedIndices($lv),2))
EndIf
EndFunc
|