forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Registry Access Demo...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Oct 29, 2002 10:38 pm    Post subject: Registry Access Demo... Reply with quote

Here's a short demo on accessing the registry and
obtaining lists of keys and their values.

This demo DOES NOT write or remove anything from
the registry. To modify the registry, you can use the
REGISTRY WRITE or REGISTRY DELETE commands.

The list on the left is loaded with subkeys from:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion

Some of these will have immediate keys with values (such
as "Run"), others have subkeys that also have subkeys
etc. etc. which will show no value, just the next layer of
subkeys.

Values are retrieved with @regread().

Hope this is helpful.
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"Registry Demo (read only)",-1,0,500,220
  DIALOG ADD,TEXT,T1,5,5,,,"Click these for a list of subkeys/values:"
  DIALOG ADD,TEXT,T2,5,250,,,"The list of subkeys and values (if they exist):"
  DIALOG ADD,LIST,L1,20,5,245,180,,CLICK,SORTED
  DIALOG ADD,LIST,L2,20,250,245,180
  rem -- Add horizontal scroll to lists --
  %z = @sendmsg(@winexists(~L1),$0194,2000,0)
  %z = @sendmsg(@winexists(~L2),$0194,2000,0)
  DIALOG ADD,STATUS,Stat,"LOCAL,Software\Microsoft\Windows\CurrentVersion"
DIALOG SHOW

rem -- Used for retrieving keys that have SUBKEYS --
LIST REGKEYS,L1, LOCAL, Software\Microsoft\Windows\CurrentVersion

if @match(L1, "Run")
   if @equal(@len(@item(L1)), 3)
      goto L1CLICK
   end
end

:EVLOOP
  WAIT EVENT
  goto @event()

:L1CLICK
  LIST CLEAR, L2

  rem -- Used for retrieving keys that have VALUES --
  LIST REGVALS,L2, LOCAL, Software\Microsoft\Windows\CurrentVersion\@item(L1)
  if @equal(@count(L2), 0)
     goto EVLOOP
  end

  rem -- Loop thru list L2 and retrieve values of each key --
  %%numkeys = @count(L2)
  LIST ADD, L2, ""
  LIST ADD, L2, "Values retrieved with @regread():"
  LIST ADD, L2, ""
  %x = 0
  REPEAT
    if @regread(LOCAL, Software\Microsoft\Windows\CurrentVersion\Run, @item(L2, %x))
       LIST ADD, L2, @item(L2, %x) = @regread(LOCAL, Software\Microsoft\Windows\CurrentVersion\Run, @item(L2, %x))
    end
    %x = @succ(%x)
  UNTIL @equal(%x, %%numkeys)
  goto EVLOOP

:CLOSE
  EXIT

Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Jimjams
Newbie


Joined: 23 Sep 2002
Posts: 21

PostPosted: Wed Oct 30, 2002 6:11 pm    Post subject: Reply with quote

Thx Mac, this will come in handy... Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group