TDirView

Version 2.4

Copyright © 1999 by Ingo Eckel
All rights reserved.

e-mail: mailto:Ingo.Eckel@t-online.de
web site: http://home.t-online.de/home/ingo.eckel/d4comp.htm

Overview:

TDirView is a visible VCL-component based on the Delphi4-component TCustomListView. It is designed to display the files and subdirectories of a single directory as a ListView using shell icons. It supports displaying the system context menu, property sheets, the creating, renaming, deleting, copying and moving of files and directories and full OLE-drag&drop from and to the explorer using drag&drop cursors and images. It also encapsulates copy, cut and pasting files and directories from and to the clipboard. Undo the copy and move of files is supported (not: undelete). It has properties to retrieve the cumulated filesize of the displayed and selected files. It is able to fetch the display icons of files delayed to avoid blocking the application when retrieving these icons from the shell. Multiple filefilters are supported and the current sortorder is displayed by an icon in the ListView's header. Changes in the filesystem, done by other applications will be detected automatically and causes the reloading of the displayed items. Reloading the items preserves the selected and focused state of each item. Shortcuts to directories will be automatically resolved when double-clicking them.

TDirView has extended drag&drop capabilities: it automatic scrolls the controls window vertically, if during a drag&drop operation the cursor is near the top or bottom edge of the control. Files or directories could be dropped on a subdirectory. Dropping files on another file (executable, shortcut) is currently not implemented.

TDirView does not use the ListView virtual mode. It adds dummy items for each file or subdirectory to display. The data required to display the item is retrieved only on request by the system (message CN_NOTIFY). Thus every item has the property Item.Caption filled with the filename but the subitems of the item are empty. The internal data used to manage the listitems is stored as a pointer to the structure TFileRec in the property Data of each listitem.


Features:


Public properties:

 

FilesSize : Cardinal
Contains the cumulated filesize of all displayed items. Subdirectories allways have the size 0. To retrieve the number of currently displayed files use the property TDirView.Items.Count.
 
FilesSelSize : Cardinal
Contains the cumulated filesize of all selected items. Subdirectories allways have the size 0. To retrieve the number of currently selected files use the property TDirView.SelCount.
 
LastPath : String
Contains the absolute path to the previous displayed directory.
 
ReloadTime : TSystemTime
Systemtime since last reloading the directory.
 
DirOK : Boolean
True, if the currently displayed directory is valid.
 
DriveType : Integer
Contains the drivetype of the currently displayed directory. The result is the value for drivetypes as defined in windows.pas, for example DRIVE_FIXED, DRIVE_REMOTE, ..
 
isRecycleBin : Boolean
True, if the currently displayed directory is the recycle bin.
 
LoadEnabled : Boolean
Enables or disables the reloading of the directory. If set to False and a change in the filesystem is detected or the method Load is called, then the property Dirty is set to True. If Dirty is True, setting the property LoadEnabled to True reloads the directory.
 
Dirty : Boolean
True, if LoadEnabled is False and the method Load was called.
 
Loading : Boolean
True, if the control is currently populating the listview.
 
Path : String
Absolute path to the current displayed directory without trailing slash: C:, C:\WINDOWS...
 
PathName : String
Absolute path to the current displayed directory trailing slash, if the directory is the root directory: C:\, C:\WINDOWS...
 
DriveView : TObject
Pointer to the linked component TDriveView. Do not set this property manual. It will be updated, when setting the property TDriveView.DirView.
 
SmallImages : TImageList
Contains the system imagelist for 16x16 small images. Do not change this value!
 
LargeImages : TImageList
Contains the system imagelist for 32x32 large images. Do not change this value!
 
Items Stored False
Delphi's standard property to access the listitems. It makes no sense, to store the files and directories of any directory in the form.
 
ColumnOrder : TColumnOrder
Contains a array of integers, wich represents the display order of the list columns. This value may change, if the user has dragged the columns to another position.
 
DragDropFilesEx : TDragDropFilesEx
Points to the instance of the drag&drop component.
 
DragDrive : TDrive
Contains the driveletter of the files being dragged during a drag&drop operation.
 
CanUndoCopyMove : Boolean
True, if the TFileOperator can undo the last copy or move of a files or directories. The TFileOperator cannot undo deleting files, even if they where moved to the recycle bin
 
DDFileOperator : TFileOperator
Points to the instance of TFileOperator wich implements the interface to the shells function shFileOperation.
 

Published properties:

 

SortColumn : TSortColumn
Current active column for sorting. Possible values are:
sName, sSize, sType, sDate and sAttr.
Changing the value of this property resorts the listview and updates the sortcolumn icon.
 
SortAscending : Boolean
True, if the current sort order is ascending. Changing this value resorts the listview and updates the sortcolumn icon.
 
ColWidthName : Integer
Width of the column containing the filenames.
 
ColWidthSize : Integer
Width of the column containing the filesizes.
 
ColWidthType : Integer
Width of the column containing the filetypenames.
 
ColWidthDate : Integer
Width of the column containing the file's date and -time.
 
ColWidthAttr : Integer
Width of the column containing the file attributes.
 
ConfirmDelete : Boolean
Confirm physical deletion of directories. The message window is created by the windows-function shFileOperation.
 
ConfirmOverwrite : Boolean
Confirm overwriting existing files during a drop or paste of files or directories. The message window is created by the windows-function shFileOperation.
 
WatchForChanges : Boolean
Enables or disables the watching of the actual directory for changes in the filesystem. The control detects creating, renaming and deleting files or directories and changing fileatributes. Watching for changes is not supported on network drives.
 
ChangeInterval : Cardinal
Reload the listview after ChangeInterval milliseconds, when a change was detected.
 
UseIconUpdateThread : Boolean
Set this property to True, if you wish to fetch the display icons of certain filetypes (EXE, PIF, LNK, etc.) delayed to avoid blocking the application, when retrieving the displayicon from the shell.
 
ShowColumnIcon : Boolean
Enables or disables the display of the sorting symbol in the listview's header. If you prefer the icon displayed in gray color, enable the define GRAYCOLICON in the source Dirview.pas or in your project. If you wish to use different icons, you must edit the resourcefile Dirview.res. The default bitmaps used to display the columnicon are UPARROW2 and DOWNARROW2. The alternative bitmaps UPARROW and DOWNARROW are a little bit bigger than the default icons.
 
DimmHiddenFiles : Boolean
Display items with the Hidden-attribute set in gray color.
 
ShowDirectories : Boolean
Enables or disables the display of subdirectories.
 
UseSystemContextMenu : Boolean
Enables or disables the display of the system contextmenu, when right-clicking a file or directory.  If disabled, a right-click will popup the the menu owned by the property PopupMenu, if it exists. Right-clicking in a empty area below the last item allways pops up the menu owned by the property PopupMenu. The system contextmenu is implemented by the unit ItemProp.
 
UseIconCache : Boolean
Enables or disables caching the display icon of registered file extensions.
 
DateTimeDisplay : TDateTimeDisplayMask
Controls the display of the last write time for each item. The control uses the date format of the localized windows installation. Possible values are

dtdDateTimeSec: The filetime is displayed as date, time and seconds.
dtdDateTime: The filetime is displayed as date and time without seconds.
dtdDate: The filetime is displayed only as date.
 
SelArchive : TSelAttr
Controls, wether files with the Archive-attribute set should be displayed in the listview. This property is ignored for subdirectories. Possible values are:

SelDontCare: This fileattribute is ignored.
SelYes: The control displays only files with this attribute set.
SelNo: The control displays only files with this attribute not set.
 
SelHidden : TSelAttr
Controls, wether files with the Hidden-attribute set should be displayed in the listview. This property is ignored for subdirectories. Possible values are:

SelDontCare: This fileattribute is ignored.
SelYes: The control displays only files with this attribute set.
SelNo: The control displays only files with this attribute not set.
 
SelSysFile : TSelAttr
Controls, wether files with the SysFile-attribute set should be displayed in the listview. This property is ignored for subdirectories. Possible values are:

SelDontCare: This fileattribute is ignored.
SelYes: The control displays only files with this attribute set.
SelNo: The control displays only files with this attribute not set.
 
SelReadOnly : TSelAttr
Controls, wether files with the ReadOnly-attribute set should be displayed in the listview. This property is ignored for subdirectories. Possible values are:

SelDontCare: This fileattribute is ignored.
SelYes: The control displays only files with this attribute set.
SelNo: The control displays only files with this attribute not set.
 
SelFileSizeFrom : Integer
Controls wich files are included in the display. The dimension is bytes.
 
SelFileSizeTo : Integer
Controls wich files are included in the display. The dimension is bytes.
 
SelFileDateFrom : Word
Controls wich files are included in the display. The value for the minimum date is $21 (01.01.1980).
 
SelFileDateTo : Word
Controls wich files are included in the display. The value for the maximum date is $EF9F (12.31.2099).
 
SelFileTimeFrom : Word
Controls wich files are included in the display. The value for the minimum time is 0 (00:00:00).
 
SelFileTimeTo : Word
Controls wich files are included in the display. The value for the maximum time is $C000 (24:00:00).
 
UseDragImages : Boolean
Enables or disables the use of dragimages during a OLE-drag&drop operation. When dragging a single item, a symbol representing this item will be displayed, when draging multiple items the component displays a unique symbol. Displaying the dragimage on Windows95-systems without system updates (not: Windows98, NT4) may cause a flickering dragcursor. Thus, your application should have a option to disable this feature, if you plan to distribute your application to Windows95-users.
 
TargetPopUpMenu : Boolean
Enables or disables the Explorer-like display of the popupmenu when dropping files or directories on the control using the right mouse button.
 
Columns : TListColums Stored False
The listcolumns are not stored in the form. This is neccessary due to a bug in Delphi4: dragging the listcolumns causes an AV, if the columns are stored in the form. You must use the properties ColWidthName, ColWidthSize, ColWidthType, ColWidthDate and ColWidthAttr to control the columns width at design time.
 
Property ShowMaskInHeader : Boolean
Enables or disables the display of the current filefilter in the listview's header column Name. The column header is set to "Name (*.pas;*.dfm)" for example.
 
Property ShowAnimation : Boolean
Enables or disables the display of a AVI-animation when loading a large directory. If enabled, the animation is shown after 1 second centered in the component's window.
 

Methods:

 

Function UndoCopyMove : Boolean
Initiates the undo of the last copy or move operation with directories or files performed by the TFileOperator. Copy or move fileoperations can result from dropping files or directories onto the controls window or by using the method PasteFromClipBoard.
 
Procedure EmptyClipboard
Empties the Windows system clipboard and clears the property Cut of all items.
 
Function CopyToClipBoard : Boolean
Copies the selected files and directories to the clipboard.
 
Function CutToClipBoard : Boolean
Cuts the selected files and directories to the clipboard and sets the property TListItem.Cut to True.
 
Function CanPasteFromClipBoard : Boolean
Returns True, if the clipboard contains files or directories.
 
Function PasteFromClipBoard : Boolean
Paste the files or directories from the clipboard into the current displayed directory. The file operation is performed by the TFileOperator.
 
Function UndoCopyMove : Boolean
Initiates the undo of the last copy or move operation with directories or files performed by the TFileOperator. Copy or move fileoperations can result from dropping files or directories onto the controls window or by using the method PasteFromClipBoard.
 
Procedure StartWatchThread
Starts or restarts the thread wich watches the current directoy for new, renamed or deleted files or directories. This method is only applicable, if the property UseWatchThread is set to True.
 
Procedure StopWatchThread
Stops the thread watching the current directoy for new, renamed or deleted files or directories. This method is only applicable, if the property UseWatchThread is set to True.
 
Function WatchThreadActive : Boolean
Returns True, if the watchthread is active. The watching of the filesystem for changes may not work for network drives.
 
Procedure StartIconUpdateThread
Starts the icon update thread wich fetches the display icons from the shell. The tread will be automatically started when finishing loading the directory and the property UseIconUpdateThread is set to True.
 
Procedure StopIconUpdateThread
Stops the icon update thread wich fetches the display icons from the shell.
 
Procedure TerminateThreads
Terminates all threads created by the control. This method should only be called when terminating the application.
 
Procedure ClearIconCache
Clears the iconcache for registered filetypes. The cache is only used, when the property UseIconCache is set to True.
 
Procedure BuildFileList(List : TStringList)
Returns a TStringList containing the absolute path to all selected items.
 
Function NormalizeMask(Mask : String) : String
Removes blanks from the current used property Mask.
 
Function CreateFile(NewName : String) : TListItem
Creates a new file in the current directory.
 
Function DeleteSelectedFiles(AllowUndo : Boolean) : Boolean
Erases the selected files and directoies from the filesystem. The method uses the TFileOperator to delete the files. If the parameter AllowUndo is set to True, the TFileOperator tries to send the files to the recycle bin. Otherwise, or if the drive is a floppy or network drive the files will by physically erased.
 
Procedure ExecFile(Item : TListItem)
Executes the given item using the shell-function ShellExecute.
 
Procedure ValidateFile(Item : TListItem)
Procedure ValidateFile(FileName :TFileName)
Checks, wether the given file or item still exists in the filesystem. If not, the item is removed from the display.
 
Procedure ValidateSelectedFiles
Checks, wether the selected items are still existing in the filesystem. If not, these items are removed from the display.
 
Function AddItem(Srec : TSearchRec) : TListItem
Adds a new item to the listview but does not creates any file or directory.
 
Procedure GetDisplayData(Item : TListItem FetchIcon : Boolean)
Refreshes the internal data structure used to manage the items. If the parameter FetchIcon is True, the display icon will also refreshed.
 
Function GetFileRec(Index: Integer): PFileRec
Returns the TFileRec-structure for the given item. This strucure is used, to manage the display of the items.
 
procedure Load(Dir : String)
Refreshes the display and loads the files and directories of the given directory into the listview, matching the search conditions. The items selected state is not preserved.
 
Procedure ReLoad(CacheIcons : Boolean)
Refreshes the display and reloads the current directory. The items selected state will be preserved. Set the parameter CachIcons to True, if you wish to preserve the ImageIndex allready fetched display icons.
 
Procedure SelectFiles(Filter : TFileFilter Select : Boolean)
Selects or unselects all files matching the filter. The filter may contain multiple filters separated by semicolons: '.txt;*.bat;*.exe'. Set the parameter Select to True if you want to select the items, to clear the selection set this parameter to False.
 
Function GetFullFileName(Item : TListItem) : String
Returns the absolute path and filename to the given item.
 
Function GetFileName(Item : TListItem) : String
Returns the filename of the given item without leading path.
 
Function GetFileNameOnly(Item : TListItem) : String
Returns the filename of the given item without extension and leading path.
 
Function GetFileExt(Item : TListItem) : String
Returns the file extension of the given item: for example: '.EXE'.
 
Procedure DisplayPropertiesMenu
Displays the property sheets as used by the Explorer for the selected files. The file operations (rename, change filetime or attributes) initated by the property sheets are handled by the Explorer. Thus the control cannot react on this operations.
 
Procedure DisplayContextMenu
Displays the system context menu as used by the Explorer for the selected files. The file operations (copy, cut, paste) initated by the system context menu are handled by the Explorer. Thus the control cannot react on this operations.
 
Procedure Syncronize
Immediatly do pending updates to the component's window. Pending updates may result from a detected filesystem change.
 
Function FindFileItem(FileName : TFileName) : TListItem
Search the list for a filename matching the parameter FileName. If found, the method returns the TListItem, otherwise NIL.
 

Events:

 

OnChangeDetected : TNotifyEvent
The watchthread has detected a change in the filesystem. A file or directory has been created, renamed or removed by another application within the current directory.
 
OnChangeInvalid : TNotifyEvent
The watchthread has signalled, that the current drive does not supports watching the filesystem for changes. This problem may occur with novell network drives.
 
OnDDDragEnter : TDDOnDragEnter = Procedure(Sender: TObject; DataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: longint; var Accept:boolean)
The controls windows has become target of a OLE drag&drop operation. The mousecursor has entered the controls window.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDDragLeave : TDDOnDragLeave = Procedure(Sender: TObject)
The controls windows is not any more target of a OLE drag&drop operation. The mousecursor has leaved the controls window.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDDragOver : TDDOnDragOver = Procedure(Sender: TObject; grfKeyState: Longint; pt: TPoint; var dwEffect: longint)
The mousecursor is moving within the controls window, while a OLE drag&drop operation is running.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDDrop : TDDOnDrop = Procedure(Sender: TObject; DataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: longint)
The mousecursor has dropped some files or directories within the controls window. This event occurs before rendering the filenames of the dropped files.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDQueryContinueDrag : TDDOnQueryContinueDrag = Procedure(Sender: TObject; fEscapePressed: BOOL; grfKeyState: Longint; var Result: HResult)
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDGiveFeedback : TDDOnGiveFeedback = Procedure(Sender: TObject; dwEffect: Longint; var Result: HResult)
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDDragDetect : TDDOnDragDetect = Procedure(Sender: TObject; grfKeyState: Longint; DetectStart, Pt: TPoint; DragStatus:TDragDetectStatus)
A OLE drag&drop operation has been initiated by the control.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDProcessDropped : TOnProcessDropped = procedure(Sender: TObject; grfKeyState: Longint; pt: TPoint; dwEffect: Longint)
The mouse has dropped some files or directories within the controls window. This event occurs before rendering the filenames of the dropped files.
For detailed informations about the event and its parameters have a look at Dieter Steinwedel's documentation of the component TDragDrop in the archive DragNDrop.zip.
 
OnDDError : TDDErrorEvent = Procedure(Sender: TObject; ErrorNo : TDDError)
This event occurs, when an error occurs during an OLE drag&drop operation. If this event is not assigned in your application the controls generates the exception EDragDrop. The parameter ErrorNo contains the errorcode and might has one of the folowing values:

DDCreateShortCutError: The control was not able to create a shortcut for the dropped files. The targetdrive might be write-protected or you do not have sufficient access rights to create files in the target directory.
DDPathNotFoundError: The target directory of the drag&drop operation is not valid. This problem can only occur, when the control is the target of the drag&drop operation.
 
OnDDExecuted : TDDExecutedEvent = Procedure(Sender: TObject; dwEffect: Longint)
The OLE drag&drop operation with the controls window as target is completly finished. The files and directories involved in the operation has been checked for existance.
 
OnDDFileOperation : TDDFileOperationEvent = Procedure(Sender: TObject; dwEffect: LongInt; SourcePath, TargetPath: String; Var DoOperation : Boolean)
The TFileOperator will immediatly start the file operation initiated by the OLE drag&drop operation or when the method PasteFromClipBoard was called by your application. This event can only occur, when the controls window is the target of the drag&drop operation because this operation is allways handled by the target window or when pasting files from the clipboard using the method PasteFromClipBoard. This event does not occur, when the files are pasted from the clipboard by using the system context menu. In this case, the file operation is handled by the Explorer.
 
OnDDFileOperationExecuted : TDDFileOperationExecutedEvent = Procedure(Sender: TObject; dwEffect: LongInt; SourcePath, TargetPath: String)
The TFileOperator has finished the file operation initiated by the OLE drag&drop operation or when the method PasteFromClipBoard was called by your application. This event can only occur, when the controls window is the target of the drag&drop operation because this operation is allways handled by the target window or when pasting files from the clipboard using the method PasteFromClipBoard. This event does not occur, when the files are pasted from the clipboard by using the system context menu. In this case, the file operation is handled by the Explorer.
 
OnLoaded : TNotifyEvent
The control has finished populating the listview.
 
OnStartLoading : TNotifyEvent
The control will start populating the listview immediatly.
 
OnAddFile : TDirViewAddFileEvent = Procedure(Sender: TObject; Var SearchRec: TSearchRec; Var AddFile : Boolean)
A new items will be added to the listview. Set the parameter AddFile to False if you don't wish to add this item to the listview.
 
OnExecFile : TDirViewExecFileEvent = Procedure(Sender: TObject; Item : TListItem; Var AllowExec: Boolean)
The control is about to execute the given item, because the user has double-clicked on it. Set the parameter AllowExec to false, if you don't wish this item to be executed by the shell.
 
OnSelectItemNew : TLVSelectItemEvent = procedure(Sender: TObject; Item: TListItem; Selected: Boolean)
The selected item state has changed. This event is a replacement for the Delphi's event OnSelectItem, wich is used for internal purposes.
 

Global functions and variables:

 

Function CreateFileShortCut(SourceFile, Target, DisplayName : String) : Boolean
Creates a shortcut to the parameter SourceFile. SourceFile and Target must be absolute path names to a file or directory. Target is the name of the new shortcut. DisplayName should contain the name of the shortcut, wich is displayed by the shell.
 
Function ResolveFileShortCut(SourceFile : String) : String
Resolves the shortcut and returns the real file- or directoryname as absolute path.
 
Function GetIconIndex(Const AFile: String; Attrs: DWORD; Flags: UINT): Integer
Used for internal purposes. Returns the ImageIndex of the given file in the system imagelist.
 
Function GetshFileInfo(Const AFile: String; Attrs: DWORD; Flags: UINT): TSHFileInfo
Used for internal purposes. Returns the structure TShFileInfo for the given File.
 
Function COMCTL32OK : Boolean
Checks, wether the system has the updated COMCTL32.DLL wich is required to support the extended display features and dragimages. Version 4.70xxxx or higher supports the extended display styles. Version 4.70 is included in Internet Explorer 3. Updates of COMCTL32.DLL are available at
http://msdn.microsoft.com/developer/downloads/files/40Comupd.htm
 
HasExtendedCOMCTL32 : Boolean
Returns True, if the system has the updated COMCTL32.DLL wich is required to support the extended display features and dragimages.
 
UnKnownFileIcon : Integer
Contains the shell's iconindex for unregistered filetypes.
 
DefaultExeIcon : Integer
Contains the shell's default iconindex for executables (COM, EXE).
 
StdDirTypeName : String
Contains the shell's default typename for directories.
 
StdDirIcon : Integer
Contains the shell's default iconindex for not selected directories.
 
StdDirSelIcon : Integer
Contains the shell's default iconindex for selected directories.
 
LastClipBoardOperation : TClipBoardOperation
Contains the value of the last executed clipboard operation. Possible values are cboNone, cboCut and cboCopy. This variable is used by TDriveView and TDirView.
 
DragImageList : TImageList
Used for internal purposes.
 
WinDir : String
Contains the windows directory of the system. In most cases C:\WINDOWS.
 
TempDir : String
Contains the directory, wich is used to store temporary files.
 
Function GetShellDisplayName(Const ShellFolder: IShellFolder; IDList: PItemIDList; Flags: DWORD; var Name: string): boolean
Returns the displayname as used by the shell.
 

Data structures

 

TFileRec = record
The record TFileRec is stored as a pointer (PFileRec) with every listitem in the property TListItem.Data. TFileRec contains the following variables, wich are used for internal purposes:

Empty : Boolean The data in TFileRec has not been updated yet by the method GetDisplayData.
IconEmpty : Boolean The display icon of teh item has not been retrieved yet.
isDirectory : Boolean The item represents a subdirectory.
FileName : String Physical filename represented by the item.
DisplayName : String When displaying the recyclebin: displayed name as used by the shell, otherwise allways the filename.
FileExt : ExtStr File extension of the file or directory.
TypeName : String Typename of the file or directory.
ImageIndex : Integer Imageindex of the fileicon in the system imagelist.
Size : Cardinal Filesize of the file.
Attr : DWORD File attributes of the file.
FileTime : TFILETIME Last write date and time of the file.
isRecycleBin : Boolean The item is the recyclebin-directory of the current drive.
PIDL : PItemIDList This variable is only used, when displaying the recyclebin. In this case it contains the PIDL of the displayed file as returned by the shell.

 


Limitations:

 

TDirView uses only pathnames of the filesystem. Virtual folders like Printers or the Control Panel does not have a physical directory and thus cannot be displayed by TDirView.

Dropping files on another file (executable, shortcut) is not implemented.

The following properties and events are used for internal purposes or are not compatible with the implementation of TDirView:

property OnCustomDrawItem
property OnCustomDrawSubItem
property OwnerData
property OnGetImageIndex
property OnCompare
property OnData
property OnDataFind
property OnDataHint
property OnDataStateChange.


History:

 

V1.0: First published release.
V1.1: - Notification handled, when linked component TDriveView is deleted.
- Problem with destroyed application icon fixed. File DIRVIEW.RES was corrupt.
- TerminateThreads was called too late. This could generate an exception, when loading a large directory and then immediatly terminating the application.
- Iconupdatethread redesigned to avoid AVs and deadlocks.
- Centralized drive management (=> TDriveInfo)
- Added property ShowDirectories enables display of directories as item.
- Added property for changing the display style of the file date and time.
- New property isRecycleBin.
V2.0: - Define FASTMODE removed, FASTMODE is know allways used.
- Complete drag&drop support for files and directories.
- Full access to clipboard operations for files and directories. Requires drag&drop functions.
- Renaming files or directories dropped from the recycle bin.
- Preserves undo informations to undo copy and move file operations. Requires drag&drop functions.
- Added properties for column width: name, size, type, date and attr.
- Now supports user-defined context menus, when right-clicking the area below the list items.
- French language support.
V2.01: - Changed formatting of filesizes (thousandseparators).
- Required compiler options inserted to avoid problems with global compiler settings different to the Delphi4 default settings.
V2.02: - Suppressed contextmenu when aborting the drag&drop by pressing ESC.
- Procedures WMRButtonUp/WMRButtonDown eliminated.
- Now using TDragDrop.DragDetect to initiate the drag&drop operation. Procedure StartDragDrop has been removed.
V2.1: - Directories with the faSysFile or faHidden attribute set should be displayed in the file list.
- Exception EInvalidOP generated by sgGetFileInfo handled. The reason for this exception is currently unknown and might be a bug in shell32.dll.
- AV in OnDDDragEnter fixed.
- Now uses Dieter Steinwedel's new MappedName feature, when processing dropped files from the recycle bin.
- Now handling BMP-files as special extension (like EXE) to retrieve the file-specific icon.
- New property UseIconCache to enable the caching of the icon index of registered file extensions. Caching is now disabled by default to avoid problems with installed non-standard icon handlers.
- Handling the LVN_BEGINDRAG and LVN_BEGINRDRAG messages sent by the control's window to initiate drag&drop. This was done to aviod problems with initiating the drag-operation, when the mouse cursor is near the controls edge.
- New Property UseSystemContextMenu to enable/disable the system context menu.
- IconUpdateThread now works also in ViewStyles vsIcon, vsSmallIcon and vsList (only Windows95/98. NT4 has problems with updating the icons by thread).
- New event OnExecFile to disable the default double-click event handler.
- Displaying a dragimage during a drag&drop operation.
- New global variable DropSource to identify the source of a drag&drop operation. This variable is used to perform a faster update of the display, when moving files.
- Changed, smaller column header icons. Enable gray column header icons by defining GRAYCOLICON.
V2.2: - New method Syncronize.
- New property ShowMaskInHeader.
- New property ShowAnimation.
- Don't freeze the application's window when loading a large directory.
- New attribute TFileRec.isRecycleBin.
- Drop on the subdirectory RECYCLED sents the the dropped files to the recycle bin.
- Now accepts the drop of files and directories with UNC-names.
- Default dropeffect is now DropEffect_Link, when dropping only executables.
- New global function isExecutable.
- Bug fixed in methods Load and SelectFiles when selecting multible attributes.
- Bug fixed when displaying dragimages. On Win95-Systems without system updates (shell??) the dragcursor has vanished. Now the cursor is just flickering (!) when dragging within the application's windows.
- Bug fixed when creating links as DropEffect.
V2.21: - Enhanced dragimage when dragging multiple items containing the number of dragged files and directories.
- Bug fixed when extracting a single executable from a Winzip archive.
V2.21a: - Bug fixed when closing the application immediatly after loading a large directory.
V2.3: - ItemProp replaced by my own version of handling the system context menu. Thus the control now also handles the rename- and cut-menuitem ot the system context menu.
- Fixed problem when changing the property MultiSelect.
- Missed Var in event OnAddFile.
V2.4: - New function GetShellDisplayName
- Using the displayname of deleted files in the recycle bin.
- Display the contextmenu and property sheet even in the recycle bin.
- Perform drag&drop with items from the recycle bin as source.
- Flickering column header fixed when painting or scrolling.
- Bug fixed when displaying the context menu: after this, filesystem changes where not detected any more.
- Bug fixed when ViewStyle = vsList and property UseIconUpdateThread is set to True: the icons have been not updated.
- Renamed method FindFileItem (former: FindCaption).