2.2.5.3.6 Registry::Registry

Description

Constructor with the reserved key.

Syntax

Registry( DWORD hParentKey )

Parameters

hParentKey
[input] Reserved key. Can be one of the following:
#define HKEY_CLASSES_ROOT           ( 0x80000000 )
#define HKEY_CURRENT_USER           ( 0x80000001 )
#define HKEY_LOCAL_MACHINE          ( 0x80000002 )
#define HKEY_USERS                  ( 0x80000003 )
#define HKEY_PERFORMANCE_DATA       ( 0x80000004 )
#define HKEY_CURRENT_CONFIG         ( 0x80000005 )
#define HKEY_DYN_DATA               ( 0x80000006 )

Return

None.

Examples

EX1

void Registry_Registry_Ex1()
{
	Registry reg(HKEY_CURRENT_USER);
	string strDialogName = "Set Value";
	string strKey = GetRegKey() + "\\Dialogs\\" + strDialogName;
	string strValueName = "AutoUpdate";

	DWORD dwVal; // output
	reg.GetValue(strKey, strValueName, dwVal);
	printf("Value of the key - %s is:\n%d\n", strKey, dwVal);
}

Remark

See Also

Registry::GetValue

Header to Include

origin.h