|
发表于 2010-2-17 12:16:11
|
显示全部楼层
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListBox.au3>
#Include <GuiListView.au3>
$x = 730
$y = 571
$Form1 = GUICreate("Form1", $x, $y, 193, 125)
$List1 = GUICtrlCreateListView("11111111|11111111|11111111|11111111|11111111|11111111", 32, 32, $x-50, $y-40,$WS_EX_ACCEPTFILES)
$menu1 = GUICtrlCreateContextMenu($List1);在指定控件或GUI窗口上创建右键菜单。GUICtrlCreateContextMenu ( [控件ID] )
$delrunning=GUICtrlCreateMenuItem("删除", $menu1);在使用本函数创建右键菜单的主控件之后,即可使用 GUICtrlCreateMenuItem 来创建每个菜单项。
;GUICtrlSetStyle($List1,BitOR($LVS_NOCOLUMNHEADER,$LVS_SORTASCENDING,$LVS_SINGLESEL),$LVS_SHOWSELALWAYS=0x0008)
GUISetState(@SW_SHOW)
read()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Read()
Local $Key2
$Sum = 0
$i=1
While 1
$Key = RegEnumKey("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options", $i)
If @error Then ExitLoop
$Key2=$Key2 & $Key & "|"
If $i/6 = Int ($i/6) Then
GUICtrlCreateListViewItem($Key2,$List1)
$Key2=""
EndIf
$i=$i+1
WEnd
;MsgBox (0,"1",$Key2)
EndFunc |
|