telmob Posted November 19, 2012 Share Posted November 19, 2012 Hello again.How can i add a list of registry values to a list box/ini file?For example, i have this in my registry:'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\', '1', "REG_SZ", 'value1''HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\', '2', "REG_SZ", 'value2''HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\', '3', "REG_SZ", 'value3'I want to read all the values and add them to the list in my GUI and to save them to a ini file.This code is a bad/imcomplete example of what i want to achieve:#include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 451, 248) $List1 = GUICtrlCreateList("", 192, 128, 233, 97) GUISetState(@SW_SHOW) getvar() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func getvar() For $i = 1 to 100 $var = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", $i) $varfile=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", $var) if @error <> 0 Then ContinueLoop Next GUICtrlSetData($List1, $varFile) EndFuncP.S.: Please forgive if the example is not very good, its 2am and i'm about to fall to the side right about now..... Link to comment Share on other sites More sharing options...
FireFox Posted November 19, 2012 Share Posted November 19, 2012 Hi, Here you go : #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 451, 248) $List1 = GUICtrlCreateList("", 192, 128, 233, 97) GUISetState(@SW_SHOW) getvar() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func getvar() Local $sListContent, $var, $varfile For $i = 1 To 100 $var = RegEnumVal("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerDisallowRun", $i) If @error Then ExitLoop $varfile = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerDisallowRun", $var) $sListContent &= $varfile & "|" Next GUICtrlSetData($List1, StringTrimRight($sListContent, 1)) EndFunc ;==>getvar Br, FireFox. Link to comment Share on other sites More sharing options...
telmob Posted November 19, 2012 Author Share Posted November 19, 2012 WOW! Thank you so much! I keep getting myself into these type of problems, i'll try to learn from it. Again, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now