Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing the Windows Registry
Message
From
19/12/2001 09:36:10
 
 
To
19/12/2001 09:05:55
Stacey King
Koala Publishing Ltd
Bristol, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00596091
Message ID:
00596120
Views:
19
Stacey,

One way is to use the WSH:
oWsh = CREATEOBJECT("wscript.shell")
*-- read a key
?oWsh.RegRead("HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\7.0\Options\Bell")
*-- write
*?oWsh.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\7.0\Options\Bell", "ON")
The following example shows how to read/write a registry key of type DWORD:
?oWsh.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\tips\DisplayInitialTipWindow")
*?oWsh.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\tips\DisplayInitialTipWindow", 0, "REG_DWORD")
You could also use the registry class that ships with VFP, but it only supports strings.

Be careful when writing to the registry! Make sure you have a backup before you start playing with this stuff.

HTH
>Hi I need to access the Windows Registry to perform the following actions:
>
>Return a value of a key (SQL Server Default Network Library) and then change the value of key so that it is set to TCP/IP
>
>I have looked at the classes and examples supplied with VFP but I they seem to be related to VFP issues and the help is not that useful, plus I do not understand enough about accessing the registry programmatically.
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform