Jump to content
Sign in to follow this  

help me ! in reg key

Recommended Posts

hi i have some question regards to my working program this is my code

#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 361, 365, 317, 191)
$Input1 = GUICtrlCreateInput("Input1", 24, 40, 169, 21)
$Edit1 = GUICtrlCreateList("", 8, 120, 337, 217)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Button1", 200, 32, 75, 25, 0)
$Button3 = GUICtrlCreateButton("Button3", 280, 32, 75, 25, 0)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  case $Button1
  Case $Button3

Func Readreg()
For $i= 1 to 100000

$var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$i)
If @error <> 0 then ExitLoop



and my GUICtrlSetData result is only the value name of a regkey can possible to show the type and the date value in regkey .... ?

Share this post

Link to post
Share on other sites

In fact, it's a "parsing" problem.

RegEnumVal function gives you the list of keys inside HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run regkey, not the values of those keys.

It's up to you to parse (get the value of) the "$var" returned key using RegRead function with something like : $value = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\",$var) and then perform the GUICtrlSetData action.

Share this post

Link to post
Share on other sites

The code you provided will change the value of your ctrl "GUICtrlSetData($Edit1,$var)" on each iteration of the loop - so it will only be the value of the last item in your "Run" list. You may want to change that, but here is some code to get you started on your question.

For $i = 1 to 10 ; change this value if you want to show more items
$var1 = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
if @error <> 0 Then ExitLoop
$var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $var1)
Switch @extended
Case 0
  $type = 'REG_NONE'
Case 1
  $type = 'REG_SZ'
Case 2
  $type = 'REG_EXPAND_SZ'
Case 3
  $type = 'REG_BINARY'
Case 4
  $type = 'REG_DWORD'
Case 5
Case 6
  $type = 'REG_LINK'
Case 7
  $type = 'REG_MULTI_SZ'
Case 8
Case 9
Case 10
MsgBox(4096, @extended,  'Name = ' & $var1 & @CRLF & 'Type = ' & $type & @CRLF & 'Value = ' & $var2 )

edit spelling

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."



WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes




GDI Basics


GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post

Link to post
Share on other sites

my next question is how can a get the value in edit hmmm

if a click the edit box it's possible to get the value of click edit box...?

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...