Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

RootKeyEx property

Project: Window State Components.

Unit: PJWdwState.

Class: TPJRegWdwState

Applies to: ~>5.6

property RootKeyEx: TPJRegRootKey;


This property allows the user to specify the registry root key under which the window size, position and state information is recorded. The information is saved in a subkey of this root key determined by the SubKey property.

RootKeyEx can take any of the values of the TPJRegRootKey [~>5.6] enumeration.

The property defaults to hkCurrentUser.

Note: The registry root key can also be specified by handling OnGetRegDataEx [~>5.6] or OnGetRegData events. If this is done then the value of RootKeyEx is ignored.

Alternative Property

The RootKey property provides an alternative way of setting the registry root key. Instead of taking a TPJRegRootKey [~>5.6] value it takes an HKEY. Note: This property has been retained for backwards compatibilty reasons. You are recommended to use RootKeyEx in all new code.

There are two main reason why RootKeyEx is considered superior to RootKey:

  1. It is impossible to specify an invalid root key value when using RootKeyEx because its value is restricted to those of the TPJRegRootKey [~>5.6] enumeration which are all valid. Conversely it is easy to provide an invalid HKEY value to RootKey.

  2. RootKeyEx displays its values in a user-friendly way in Delphi’s Object Inspector: the user chooses a value from a drop-down list of values. With RootKey the user has to type the correct HKEY value into the Object Inspector.

Setting RootKeyEx changes the value of RootKey and vice versa.