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.

OnGetRegDataEx event

Project: Window State Components.

Unit: PJWdwState.

Class: TPJRegWdwState

Applies to: ~>5.6

  TPJWdwStateGetRegDataEx = procedure(
    var RootKeyEx: TPJRegRootKey; var SubKey: string
  ) of object;

property OnGetRegDataEx: TPJWdwStateGetRegDataEx;


This event is triggered just before the registry is read when restoring and saving a window. The current values of the RootKeyEx [~>5.6] and SubKey properties are passed as var parameters of the same name to the event handler, allowing the user to change the values, and hence the location within the registry where the window data is recorded.

The RootKeyEx parameter can be set to any of the values from the TPJRegRootKey [~>5.6] enumeration.

The purpose of the event is to enable the AutoSaveRestore property to be used without setting the RootKeyEx [~>5.6] and SubKey properties at design time - i.e. handling the event allows either or both of the default RootKeyEx [~>5.6] and SubKey values to be overridden.

Alternative Event

The OnGetRegData event provides an alternative way of to change the registry root- and sub-keys. It is similar to OnGetRegDataEx except that the root key is specified as a valid HKEY value.

Note: You are recommended to use OnGetRegDataEx in preference to OnGetRegData. If you choose to handle OnGetRegData do not also handle OnGetRegDataEx because doing so prevents OnGetRegData from being fired.