The window state components can save and restore a window's size, positionand state (minimized, maximized or normal) between program executions. Twocomponents are provided that use different means of recording the window'sinformation. They are:TPJWdwState: This component records window information in an ini file. Theuser has control over the ini file name (via the IniFileName property) and thename of the section of the file where window information is recorded (using theSection property). Alternatively the ini and section names can be configuredby handling the OnGetIniData event that is triggered immediately before theini file is read or written.TPJRegWdwState: This component uses the registry to record windowinformation. The registry root key and sub key where the information is storedare controlled by the RootKey and SubKey properties, or by handling theOnGetRegData event. This event is triggered just before the registry isaccessed.Both components implement the same functionality, controlled by some commonproperties and events, as follows:The components can automatically restore and save windows when the programstarts up and closes down (using the AutoSaveRestore property). IfAutoSaveRestore is set to False then the Restore and Save methods must becalled from the host application.The OnReadWdwState event can be handled in order to change the storedwindow's state, size and position values before the window is restored. Thisevent is called after reading the data and before sizing the window.The Options property can be used to customise the way the window isrestored. State, and position can be ignored, which is useful for dialogboxes that should retain the same size and not be minimizied. The window can also be kept within the desktop's work area.When the form is to be restored in a minimized state it briefly appears onscreen in the normal state before being minimized. The MinimizeDelay propertycontrols the delay between the window appearing and being minimized.An abstract base class for both components l TPJCustomWdwState l is alsoprovided. This class provides the core window handling and sizing functionality.It provides abstract methods for accessing the required storage medium.Therefore it is quite straightforward to create further components that usealternative storage systems. All that needs to be provided are methods toread/write the window information along with any additional properties thatare required to configure the storage medium.A help file is included that integrates into the Delphi 3 to 7 OpenHelpsystem. The help does not integrate with Delphi 2005 and later, but can be usedindependently of the IDE, with some loss of functionality.A property editor is provided for editing HKEY values (such as the registryroot key property of TPJRegWdwState). This editor is also availableseparately. |