Shiny Language Reference

Language Reference > Registry Functions


readprofiledword

dword readprofiledword(string Value, dword Default);

 

Synonyms:

dword rpdword(string Value, dword Default);

 

Reads a profile dword from the registry

READPROFILEDWORD returns the contents of the specified dword value in the registry. When a new SSE is loaded by Brass, a registry key is created for it under HKCU\Software\32Bits\Brass\Shiny<plugin_filename>. This key is used to store the position, size and configuration of the display panel as well as associated settings that all plugins have access to (for example, hotkeys). Plugins may read values from and write values to this registry key to manage their configuration and internal settings. The standard registry profile functions are not designed for general-purpose registry access. Instead they are intended to allow plugins to store configuration and ensure that any such configuration stored is unique to the plugin instance. This is why the registry functions do not allow the selection of registry keys. Refer to GETSELFNAME for more information on unique instances.

READPROFILEDWORD must only be used to retrieve data from registry values specified as dwords. There is technically no difference between this statement and using READPROFILEINT with implicit type conversion, however there are situations where a DWORD value is more convenient to directly return (or where an INT cnanot hold the value).

This statement is only valid in the RegRead handler

 

Parameters

Value

The name of the registry value to read

Default

If the value doesn't exist (for example, this is the first time the plugin has been loaded), the value specified here is used as the return value for the statement. This ensures READPROFILEDWORD always returns a sensible value without requiring a separate check to see if the registry value exists.

 

Return Value

The data read from the value, or the default value if the registry value doesn't exist.

 

Example Code

// Get the contents of the SettingMask value from the registry
dword SettingMask = readprofiledword("SettingMask", 0x0000ffff);