# RegReadULong

int RegReadULong (unsigned int rootKey, const char subkeyName[], const char valueName[], unsigned long *uLongData, int dataFormat);

## Purpose

This function reads unsigned 32–bit (unsigned long) data from the specified Key Value in the Windows Registry. You must specify a Root Key, a Subkey of that Root Key, and the actual Value of that Subkey which you want to read.

Example:

unsigned long number;
// Reads the data in MyULongValue in Little–Endian format
RegReadULong (REGKEY_HKLM, "Software\\MySubKey",
"MyULongValue", &number, 0);

## Parameters

Input
Name | Type | Description
rootKey | unsigned integer | The Root Key under which you wish to access a Subkey and its value. See the Windows Registry functions Class help for more information on Root Keys.
subkeyName | const char [] | The name of the Subkey (relative to the Root Key), from which you wish to read value data. See the Windows Registry functions Class help for more information on Subkeys.
valueName | const char [] | The name of the Value from which you want to read data. See the Windows Registry functions Class help for more information on Key Values.
dataFormat | integer | This parameter specifies how the 32–bit integer is stored in the Registry. Typically, you will specify Little–Endian (Intel) format.
Output
Name | Type | Description
uLongData | unsigned long * | Returns the unsigned long contents of the specified Value of the specified Subkey.

## Return Value

Name | Type | Description
status | integer | The status code that the function returns. 0 indicates success. A negative value indicates an error. This function may return a Programmer's Toolbox or UI Library error code. Call GetGeneralErrorString to obtain a text description of the error.