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.
Project: Window State Components.
Unit: PJWdwState.
Class: TPJWdwState
Applies to: ~>5.0
property IniFileName: string;
This property specifies the name of the ini file that will be used to record the window’s size, position and state. The file is accessed by both the Restore and Save methods.
The default value of the property is the empty string.
The behaviour of the property was changed at v5.5:
<5.5
The property can be interpreted in the following ways, depending on its value:
Empty string:
The ini file name is the same as the application, with the extension changed to .ini
. The file is placed in the same directory as th application. For example, if the application is C:\Foo\Bar.exe
then the full ini file name will be C:\Foo\Bar.ini
.
Relative path: (e.g. Foo.ini
or Foo\Bar.ini
)
The ini file name is as specified in this property and it is stored in the Windows installation directory. For example an IniFileName property value of Foo.ini
might result in an ini file name of C:\Windows\Foo.ini
while a property value of Foo\Bar.ini
would save window state data in C:\Windows\Foo\Bar.ini
.
Absolute path:
The ini file is stored in the specified path.
If the the ini file’s directory does not exist an exception will be generated when the component attempts to write to the ini file.
~>5.5
The property can be interpreted in the following ways, depending on its value:
Empty string:
The ini file name is the same as the application, with the extension changed to .ini
. The file’s directory depends on the value of the IniRootDir property.
Relative path: (e.g. Foo.ini
or Foo\Bar.ini
)
The ini file name is as specified in the property. The file’s directory depends on the value of the IniRootDir property.
Absolute path:
The ini file is stored in the specified path. The value of the IniRootDir property has no effect in this case.
If the ini file’s directory does not exist it will be created if possible when the component first attempts to write to the file. If the directory cannot be created an exception will be raised.
Important note: When updating from earlier versions to ~>5.5, you should note that TPJWdwState uses a different file name by default when IniFileName is either a relative path or the empty string. To revert to the original behaviour you need to change the IniRootDir property value as follows:
rdExeDir
.rdWindowsDir
.The value of IniFileName can be overridden at run time if you handle either the OnGetIniData or OnGetIniDataEx [~>5.5] properties. This can be useful when the AutoSaveRestore property is True
and you want to specify the ini file name at run time. In this case setting IniFileName at run time will not work because the form will be restored before you have an opportunity to change the property value. However the OnGetIniData and OnGetIniDataEx events are triggered before the form restores, enabling the file name to be specified.
You are strongly recommended not to store the ini file in the Windows directory. On Windows Vista and later an attempt to write to the Windows directory may be redirected to the virtual store.
You should not use the directory containing the executable program if it is stored in the Program Files directory (or similar), since you may not have write access to it.