Saturday, September 2, 2017

Adding custom Visual Effects performance options to the Performance Options dialog

The Performance Options dialog (accessible from the Advanced tab of the System Properties dialog) loads the list of visual effects from the Registry, specifically from here:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects

Each subkey is one option in the dialog. It's possible and fairly simple to add new entries. Most of the default ones use the SPIActionGet and SPIActionSet values to specify the uiAction parameter to SystemParametersInfo. A couple, however, are backed by Registry values, so new checkboxes can be added to control Registry values elsewhere.

These values are necessary to define a Registry-backed checkbox:

  • HKeyRoot, a DWord that specifies the common Registry handle to use as a root. This should probably be 0x80000001 (for HKCU).
  • RegPath, a string specifying the key path under the root hive.
  • ValueName, a string specifying the name of the value in the specified key to control with the setting.
  • CheckedValue, a DWord containing the data to set into the specified value when the box is checked.
  • UncheckedValue, likewise if the box is unchecked.
  • DefaultValue, a DWord with the default data for the backing Registry value if it does not exist.
  • Type, a string set to checkbox.
  • Text, a string holding the display name of the setting. This can be the literal setting title or, if it starts with @, a resource from a DLL.
Configuration for a new setting
The resulting setting
Checking and unchecking that box does indeed set the corresponding Registry value.

No comments:

Post a Comment