Link to home
Start Free TrialLog in
Avatar of jcorbin
jcorbin

asked on

Reading Registry Values

I need to read some registry values, not my applications registry but for example this key:

HKEY_LOCAL_MACHINE\\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion



ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AnswerTheMan
AnswerTheMan

add a reference to 'registry access functions' .

add the following code into your form

Option Explicit

Private Sub Command1_Click()
Dim MyRegAs New Registry

MyReg.UpdateKey HKEY_CURRENT_USER, "Control panel\desktop", "SCRNSAVE.EXE", "your screensaver path"
Set MyReg= Nothing
End Sub
Avatar of jcorbin

ASKER

Worked great! thanks!
which one ?
the "Accepted Answer" or the "Comment" ?
Avatar of jcorbin

ASKER

The accepted answer. never could find the type lib for 'registry access functions' ??? Is that a ms library??
dependns on version you have.
Functions will use the built-in APIs without the need to distribute another DLL with your program.

I always try to use code before resorting to an outside DLL or OCX.