Results 1 to 3 of 3

Thread: registry question...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    Question registry question...

    hello,

    how do i write to the registry and how do i extract data from the registry?


    thanx!
    Dekel C.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    ' Save text1's value
    SaveSetting App.EXEName, "textboxes", "text1", text1.text

    ' Get text1's value
    text1.text = GetSetting (App.EXEName, "textboxes", "text1", "")

    SaveSetting stores the data in the Registry (in HKEY_CURRENT_USER|Software|VB and VBA Program Settings|YourAppName). The four parts of the function are the name under which it is stored (App.EXEName in this case), "textboxes" in this example is like the section name in an ini file, "text1" is like the key in a line of data in the ini file, and text1.text is the value.

    GetSetting returns the value. The 4th parameter ("" in this case) is optional and it is the default if no registry entry is found.

  3. #3
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396
    Saves or creates an application entry in the application's entry in the Windowsregistry.

    VB Code:
    1. [b]Syntax[/b]
    2.  
    3. SaveSetting appname, section, key, setting
    4.  
    5. 'Example
    6. SaveSetting "MyProgram", "Mysection", "Key1", "2000"
    7.  
    8. 'To retrieve
    9. Dim strKey1 as string
    10. strKey1 = GetSetting("MyProgram", "Mysection", "Key1")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width