Shell Folders Unit
This unit provides various components, classes and routines for handling
Windows shell folders. It contains:
- A component that provides information about a specified special shell
- A class that enumerates all the special shell folders.
- Routines to manipulate special shell folder information.
- A component that encapsulates the Windows Browse for Folder dialog
- A property editor for special shell folder identifiers.
The unit is compatible with Delphi 3 to 7. It has been tested in Delphi 4,
6 and 7.
In these instructions
$(DELPHI) is to be taken
to represent the path where the appropriate version of Delphi is installed.
- Unzip the downloaded zip file into a folder of your
choice, preserving the directory structure. The following files will be
PJShellFolders.pas – component
PJShellFoldersDsgn.pas – design unit
containing property editor and component registration.
PJShellFolders.dcr – contains component
PJShellFolders.hlp – help file for
integration with Delphi IDE.
PJShellFolders.als – "A" keyword
file for integration with Delphi 6 or 7 OpenHelp system.
SpecialFolderDescs.html – describes each of
the supported shell folders.
pjshfldr.htm – information about the
Demo\ShellFolderDemo.dpr – demo program
Delphi project file.
Demo\ShellFolderDemo.cfg – config file for
Demo\ShellFolderDemo.res – icon for demo
Demo\ShellFolderDemoForm.pas – demo source
Demo\ShellFolderDemoForm.dfm – demo form
Demo\DemoReadMe.html – describes use and
design of demo program.
where you wish to install into Delphi. This will probably be a sub-folder of
- Install the components and property editor by chosing the
Component | Install Component menu option to display the
Install Component dialog box. Then:
- Select the Into existing package
- Click the Browse button next to the Unit file
name edit box to display the Unit file name dialog
PJShellFoldersDsgn.pas from the file dialog and click
OK to return to the Install Component dialog
- Choose the design package into you wish to install from the
Package file name drop down list.
- Click OK.
- A confirmation dialog box may be displayed, querying whether
it is OK to rebuild and reinstall the package. Click Yes
- The package will now be built and a dialog box should be
displayed that states that the TPJBrowseDialog and
TPJSpecialFolderInfo components have been installed.
Click OK to dismiss the dialog box.
- The components will appear on the "DelphiDabbler"
- If you wish you can delete
from the place where you copied them (but ensure that the
files are not deleted).
- The simplest way to install the help file
PJShellFolders.hlp) is to use my
Help Installer Expert.
If you prefer to install manually,
article explains the process. When using Delphi 6 or 7
PJShellFolders.als should also be copied to the
- The supplied demo program can be loaded into Delphi and
compiled and run as required.
Known Bugs and Fixes
The following is a list of known bugs along with notes of the releases where
they were fixed:
- Special folder ID property editor was read-only and not
permitting special folder IDs to be edited at design time.
Fixed in release 2.2.1
- HelpContext property did not have default
Fixed in release 2.2
- Compiler warnings were being displayed when compiled with
Delphi 6 or 7.
Fixed in release 2.1
- Display names not being shown correctly on Windows NT
Fixed in release 2.0
If you wish to report a bug please use my
website contact page and
describe the bug clearly, specifying "PJShellFolders" and the version
of the component you are using.
Release 2.2.1 of 09 January 2005
PJShellFolders v2.2.1 of 09 January 2005
- Fixed bug in shell folder ID property editor that was preventing user
from changing the value of properties at design time.
Release 2.2 of 22 August 2004
PJShellFolders v2.2 of 22 August 2004
- Added support for new dialog style - selected using a new option in the
- Provided default specifier of 0 for HelpContext property.
- Added support for more new special folder indentifiers.
- Updated help file re new TPJBrowseFolder option and added additional "A"
keywords to improve Delphi help integration. Help about box text
- Provided new .als file for integration with Delphi 6 or 7 OpenHelp
- Changed to Mozilla public license.
Release 2.1 of 29 Jul 2003
PJShellFolders v2.1 of 29 Jul 2003
- Prevented compiler warnings being issued when compiling under Delphi 6
- Added support for additional special shell folders.
Release 2.0 of 15 Jun 2003
PJShellFolders v2.0 of 15 Jun 2003
- Fixed bug that meant that display name wasn't being shown correctly in
Win NT OSs.
- Added new OnSelChangeEx event to TPJBrowseDialog component that exposes
selected folder's PIDL.
- Enabled TPJBrowseDialog to display and accept virtual as well as file
- TPJBrowseDialog now displays disabled help button when HelpContext is
- Additional shell folder identifiers missing from Delphi 3 are now
conditionally placed in interface of unit in Delphi 3.
- Added new public functions to get folder path and display name from
- All errors in components and routines now raise EPJShellFolder
- Property editor and component registration moved to separate design time
- Help file corrected and updated.
Release 1.0 of 06 Apr 2001
PJShellFolders v1.0 of 01 Apr 2001
- Original version with help file and HTML documentation.
License & Disclaimer
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
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 Shell Folders Unit.
The Initial Developer of the Original Code is Peter Johnson
Portions created by the Initial Developer are Copyright © 2001-2005
Peter Johnson. All Rights Reserved.
About the Author
I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales,
UK. I write mainly in Delphi. My programs are available for download on my
I can be contacted via the
contact page of my