Hi,
Ich mach mir n kleinen Autostart manager.
Die Appnamen werden korrekt augelsen und aufgelistet, aber die SubItems stimmen nicht?
Wieso? ;o
Ich mach mir n kleinen Autostart manager.
Die Appnamen werden korrekt augelsen und aufgelistet, aber die SubItems stimmen nicht?
Wieso? ;o
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoStart Manager", 448, 275, 192, 124)
$Button1 = GUICtrlCreateButton("Get AutoStart Items", 8, 8, 107, 25)
$ListView1 = GUICtrlCreateListView("Name|App Path|Registry Path", 10, 40, 426, 222)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 170)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 170)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Const $HKCU_RUN = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run'
Const $HKCU_RUNONCE = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce'
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$i = 1
While @error = 0
Local $var = RegEnumVal($HKCU_RUN, $i)
Local $var2 = RegEnumVal($HKCU_RUNONCE, $i)
If @error <> 0 Then ExitLoop
$i += 1
if $var <> '' Then
_GUICtrlListView_AddItem($ListView1, $var, 0)
_GUICtrlListView_AddSubItem($ListView1,$i,'HKCU - Run', 1)
EndIf
if $var2 <> '' Then
_GUICtrlListView_AddItem($ListView1, $var2, 0)
_GUICtrlListView_AddSubItem($ListView1,$i,'HKCU - RunOnce',1)
EndIf
WEnd
EndSwitch
WEnd