RegistryGet
PowerScript function
Description
Gets a value from the Windows system registry.
Syntax
|
1 |
RegistryGet ( key, valuename, { valuetype }, valuevariable ) |
|
Argument |
Description |
|---|---|
|
key |
A string whose value names the key in the system To uniquely identify a |
|
valuename |
A string containing the name of a value in the |
|
valuetype |
A value of the RegistryValueType enumerated datatype
|
|
valuevariable |
A variable corresponding to the datatype of |
Return value
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 2 3 4 |
string ls_titlefont RegistryGet( & "HKEY_LOCAL_MACHINESoftwareMyApp.SettingsFonts", & "Title", RegString!, ls_titlefont) |
This statement obtains the value for the name NameOfEntryNum and
stores it in the long ul_num:
|
1 2 3 |
ulong ul_num RegistryGet("HKEY_USERSMyApp.SettingsFonts", & "NameOfEntryNum", RegULong!, ul_num) |
See also