Using Win32 functions in Visual FoxPro Image Gallery
Registry
..msdn
GetPrivateProfileSectionNames
GetPrivateProfileString
GetProfileString
RegCloseKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKey
RegEnumKeyEx
RegEnumValue
RegOpenKeyEx
RegQueryInfoKey
RegQueryValueEx
RegSaveKey
RegSetValueEx
SHEnumKeyEx
SHRegCloseUSKey
SHRegEnumUSKey
SHRegOpenUSKey
WritePrivateProfileSection
WritePrivateProfileString
Code examples:
Class library providing access to the System Registry
Class library providing access to the System Registry

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
The following code includes classes registry, regkey, regkeys, regvalue and regvalues. All together they provide view, read, write and delete functionality for the System Registry. Examples showing how to use this class are coming soon.

Create Registry object before using any other class from this library. This object contains API declarations the other classes use.

LOCAL rg As Registry
rg = CREATEOBJECT("Registry")

The next snip opens Software key in HKEY_LOCAL_MACHINE and adds _test subkey to it.

LOCAL rgkey As regkey
rgkey = CREATEOBJECT("regkey",;
        HKEY_LOCAL_MACHINE, "Software")

WITH rgkey
        IF .OpenKey()
                .CreateSubkey("_test", "")
        ENDIF
ENDWITH

And the last one adds several values to a key.

WITH rgkey
        IF .OpenKey()
                .SetValue("TestValue0", 0, 16) && REG_NONE
                .SetValue("TestValue1", 1, "abc") && REG_SZ
                .SetValue("TestValue3", 3, "abc") && REG_BINARY
                .SetValue("TestValue4", 4, "128") && REG_DWORD
        ENDIF
ENDWITH
 
  Members area. Log in to view this example.
 
  User name:
  Password:
 
 
  Forgot your password?
 
  Sign up for
the Membership
 
 


User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
8250 bytes  
Created: 2004-10-18 19:25:31  
Modified: 2011-12-10 09:20:22  
Visits in 7 days: 135  
Listed functions:
RegCloseKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKeyEx
RegEnumValue
RegOpenKeyEx
RegQueryInfoKey
RegSetValueEx
Printer friendly API declarations
My comment:
RegDeleteKey: the subkey to be deleted must not have subkeys. CeRegDeleteKey (Windows CE, RAPI) deletes the subkey regardless of whether it has its own subkeys.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.234.126.92)
1.34 hrs.Example: 'Accessing LSA Policy object (Local Security Authority)'
 Function: 'GlobalAlloc'
3.02 hrs.Example: 'How to disable the Windows Clipboard (VFP9)'
 Example: 'Changing file attributes'
4.71 hrs.Example: 'MapiSendMail class for Visual FoxPro application'
5.02 hrs.Example: 'Creating a clipping region from the path selected into the device context of a form'
 Example: 'How to access a file using not its name but an alias (hard link)'
6.72 hrs.Example: 'Obtaining the bounding rectangle for the specified device context'
6.99 hrs.Example: 'How to save registry key including its subkeys and values to a file'
9.62 hrs.Example: 'Detecting changes in connections to removable drives (VFP9)'
Google
Advertise here!