RegistryGet PowerScript function
Description
Gets a value from the Windows system registry.
Syntax
|
1 |
<span>RegistryGet</span> ( <span>key</span>, <span>valuename</span>, {<span> valuetype</span> }, <span>valuevariable</span> ) |
|
Argument |
Description |
|---|---|
|
key |
A string whose value names the key in To uniquely identify a key, specify the list of parent keys |
|
valuename |
A string containing the name of a value |
|
valuetype |
A value of the RegistryValueType enumerated
|
|
valuevariable |
A variable corresponding to the datatype |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs. An error is returned if the datatype of valuevariable does
not correspond to the datatype specified in valuetype.
Usage
Long string values (more than 2048 bytes) should be stored
as files and the file name stored in the registry. For more information
about keys and value names in the system registry, see RegistrySet.
Examples
This statement obtains the value for the name Title and
stores it in the string ls_titlefont:
|
1 |
string ls_titlefont |
|
1 |
<span>RegistryGet</span>( & |
|
1 |
"HKEY_LOCAL_MACHINESoftwareMyApp.SettingsFonts", &<br>   "Title", RegString!, ls_titlefont) |
This statement obtains the value for the name NameOfEntryNum and
stores it in the long ul_num:
|
1 |
ulong ul_num<br><span>RegistryGet</span>("HKEY_USERSMyApp.SettingsFonts", &    "NameOfEntryNum", RegULong!, ul_num) |