RegDelete ( "键名" [, "值项"] )
然后刷新
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("test", 303, 339, 321, 178)
$ListView1 = GUICtrlCreateListView("键值 |值", 0, 8, 289, 273)
$button = GUICtrlCreateButton("Yes", 75, 290, 80, 40)
$delete = GUICtrlCreateButton("删除", 175, 290, 80, 40)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
read()
Case $delete
del()
EndSwitch
WEnd
Func read()
_GUICtrlListView_DeleteAllItems($ListView1)
For $i = 1 To 10
$ver = RegEnumVal("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
If @error <> 0 Then ExitLoop
$aer = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$ver)
$a = GUICtrlCreateListViewItem($ver & "|" & $aer, $ListView1)
Next
EndFunc ;==>read
Func del()
$delitem = _GUICtrlListView_GetItemText($ListView1,Number(_GUICtrlListView_GetSelectedIndices($ListView1)))
RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$delitem)
read()
EndFunc ;==>del
[ 本帖最后由 大绯狼 于 2008-10-23 15:29 编辑 ] |