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.

OnGetRegData event

Project: Window State Components.

Unit: PJWdwState.

Class: TPJRegWdwState

Applies to: ~>5.0

  TPJWdwStateGetRegData = procedure(
    var RootKey: HKEY; var SubKey: string
  ) of object;

property OnGetRegData: TPJWdwStateGetRegData;


This event is triggered just before the registry is read when restoring and saving a window. The current values of the RootKey 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.

Any value assigned to the RootKey parameter must be a valid HKEY or an exception will be raised. See the RootKey documentation for a list of valid values.

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

Alternative Event

The OnGetRegDataEx** [~>5.6] event provides an alternative way of to change the registry root- and sub-keys. It is similar to OnGetRegData except that the root key is specified as one of the value from the TPJRegRootKey [~>5.6] enumeration.

Note: You should choose which of OnGetRegData and OnGetRegDataEx [~>5.6] to handle, but should not handle both events. If you do then OnGetRegDataEx [~>5.6] will be triggered and OnGetRegData will be ignored.