Window State Components
Demo Projects Read-Me file

Introduction

There are two demo projects included with this component. They are:

  1. StandardDemo.dpr
    Demonstrates how to use the components in the standard way, i.e. dropped on a form from the component palette.
  2. StandAloneDemo.dpr
    Demonstrates how to create and use the components dynamically.

These demos were originally developed using at Delphi 7 and have been tested and found to work with Delphi 4, 6, 7 and 2006. They probably work correctly with Delphi 5 and 2005. Note: StandardDemo.dpr does not run correctly under Delphi, while StandAloneDemo.dpr compiles and runs correctly.

StandardDemo.dpr

This demo can be found in the Demos\1 sub-folder.

It has a main application window containing a button that, when clicked, displays a modal dialog box. Both the main window and the dialog contain a TPJRegWdwState component. The component in the main window is configured to persist window size, state and position. The dialog's component only persists window position. Window positions are not adjusted to remain within the work space.

Both forms demomstate the use of the OnReadWdwState event. The main form also shows how to use the OnGetRegData event and the AutoSaveRestore property.

StandAloneDemo.dpr

This demo can be found in the Demos\2 sub-folder.

It displays a single application window that dynamically creates a TPJWdwState component using the CreateStandAlone constructor. A check box is available that is used to toggle whether windows that are partially off-screen when closed are restored in exactly the same position or are restored so all the window is visible.

The program uses the TPJWdwState component's IniFileName and Section properties to require that window information is stored in the [Window] section of an ini file named Custom.ini in the demo application's directory.

If you have any comments on the components or this demo code or if you have found a bug, please let me know. You can contact me via my website contact page.