» Contents
The window state components can save and restore a window's size, position and state (minimized, maximized or normal) between program executions. Two components are provided that use different means of recording the window's information. They are:
Both components implement the same functionality, controlled by some common properties and events, as follows:
Other features include:
» Contents
The Window State Components compile with Delphi 3 and later. They have been tested with Delphi 3, 4, 6, 7 and 2006. The property editor can be used with any of the compilers supported by the components.
» Contents
The Window State Components, their documentation and demo programs are supplied in a zip file. Before installing you need to extract all the files from the zip file, preserving the directory structure. The following files will be extracted:
PJWdwState.pas
– component source
code.
PJWdwState.dcr
– resource file
containing component palette glyphs.
PJWdwState.hlp
– component help file that integrates
with the Delphi 3 to 7 OpenHelp system.
PJWdwState.als
– a-link keyword file for integration
with the Delphi 6 or 7 OpenHelp system.
PJHKEYPropEdit.pas
– HKEY property
editor.
ReadMe.htm
– this file.
ChangeLog.txt
– component's change log.
Demos\DemoReadMe.htm
– read me file explianing use of
demo programs.
Demos\WdwStateDemos.bpg
– demo project group file.
Demos\1\StandardDemo.dpr
– demo 1 project file.
Demos\1\StandardDemo.res
– icon resource for demo 1.
Demos\1\FmDemo.pas/.dfm
– 1st demo's main window form
and source.
Demos\1\FmDemoDlg.pas/.dfm
– 1st demo's modal dialog
form and source.
Demos\2\StandAloneDemo.dpr
– demo 2 project file.
Demos\2\StandAloneDemo.res
– icon resource for demo
2.
Demos\2\FmMain.pas/.dfm
– 2nd demo's main window form
and source.
You can now proceed to install the components and property editor using the
emphasised files above. Installation methods vary between
Delphi versions, so follow the instructions that apply to your version
below. Note that $(DELPHI)
represents the
path where the appropriate version of Delphi was installed. Similarly
$(BDS)
refers to the installation path of a
version of the Borland Development System.
The components must be installed into a Delphi Win32 design package. It is
assumed that you will be installing into an existing package. You may decide
to install into the "user" package:
$(BDS)\Lib\dclusr.dpk
.
Borland Studio Projects
or $(BDS)\lib
folders.
PJWdwState.pas
and PJWdwState.dcr
to the
chosen installation folder. If you wish to also install the
HKEY property editor for use with TPJRegWdwState
you should copy PJHKEYPropEdit.pas
to the same location.
.bpl
extension. Right click the package's entry and
select Add to display the Add dialog box.
Enter the full path to PJWdwState.pas
in the
Unit file name edit box (use the Browse button
to navigate to the file). Click OK to add the component
to the package.
PJHKEYPropEdit.pas
.
PJWdwState.pas
and PJWdwState.dcr
and,
if appropriate, PJHKEYPropEdit.pas
, appear under
the package's Contains node. If so, right click the
package's entry again and select Compile. If the
resulting compilation succeeds a message should be displayed
confirming that TPJWdwState and
TPJRegWdwState have been registered. The components
should now appear in the "DelphiDabbler" section of
the Tool Palette. (Note this will only appear when a form is
selected in the designer). If you have installed
PJHKEYPropEdit.pas
the property editor will be used
by the Object Inspector when a property of type HKEY
is selected.
PJWdwState.pas
and, if used,
PJHKEYPropEdit.pas
, from the chosen installation folder.
The components must be installed into a design package. It is assumed that
you will be installing into an existing package. You may wish to use the
"user" package named dclusr.dpk
or
dclusrXX.dpk
(where XX
is a version number). This
package can be found in $(DELPHI)\Lib
.
$(DELPHI)\lib
folder.
PJWdwState.pas
and PJWdwState.dcr
to the
chosen installation folder. If you wish to also install the
HKEY property editor for use with TPJRegWdwState
you should copy PJHKEYPropEdit.pas
to the same location.
PJWdwState.pas
in the Unit file
name edit box (use the adjacent Browse button to
navigate to the file). If required, repeat the previous step for
PJHKEYPropEdit.pas
. Choose the required package from the
Package description combo box, or by navigating to the
package using Browse. Click OK to confirm your
selections.
PJHKEYPropEdit.pas
the property editor will be used by the Object Inspector when a
property of type HKEY is selected.
PJWdwState.pas
and, if used,
PJHKEYPropEdit.pas
, from the chosen installation folder.
.als
file. The simplest way to install help is to use my
Component Help
Installer Expert (v2.2.1 or later). If you prefer to install
manually,
this
article explains the process.
» Contents
A complete change log is provided in a text file that is included in the download.
» Contents
This source code is subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this program except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is Window State Components.
The Initial Developer of the Original Code is Peter Johnson (http://www.delphidabbler.com/).
Portions created by the Initial Developer are Copyright © 1999-2005 Peter Johnson. All Rights Reserved.
Contributor(s):
All relevant trademarks are acknowledged.
» Contents
I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs are available for download from: http://www.delphidabbler.com/.