TDriveInfo Version 1.1 |
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:
TDriveInfo is a non-visible object used to centralize the management of the information about the installed drives. It has methods to store and retrieve the drive's valid status, its serialnumber, volumeID, imageindex, etc. and wether there is a disk inserted in the drive. The central instance of TDriveInfo is created at runtime and stored in the global variable DriveInfo. This instance will by automatically destroyed, when the application terminates. TDriveInfo is used by the components TDriveView, TDirView and TIEDriveComboBox.
Public properties:
Property Data[Drive : TDrive] : TDriveInfoRec; Default; |
You can access the informations about a specific drive by using this default property. For example like this: DriveInfo['C']. The returned record TDriveInfoRec contains all informations about the specific drive. The drive will not by accessed by using this property. To update the informations stored in this property you should call the method ReadDriveStatus first. |
Methods:
Function GetImageIndex(Drive : TDrive) : Integer |
Returns the imageindex from the system imagelist for the drive. |
Function GetDisplayName(Drive : TDrive) : String | ||||||||||||
Returns the displayname of the drive as used by the Explorer. | ||||||||||||
Function GetPrettyName(Drive : TDrive) : String | ||||||||||||
Returns the prettyfied displayname as used by TDriveView. | ||||||||||||
Function GetLongPrettyName(Drive : TDrive) : String | ||||||||||||
Returns the prettyfied displayname as used by TDriveView. On network drives the server name and -directories are also returned. | ||||||||||||
|
Global functions and variables:
Function GetShellFileName (Const Name : String ) : String |
Returns the displayname of the drive as used by the Explorer. |
Function GetNetWorkName (Drive : Char) : String |
Returns the UNC-name of the network drive. |
DriveInfo : TDriveInfo |
The central instance of TDriveInfo is stored in this global variable at runtime. |
Data structures:
TDriveInfoRec = Record | ||||||||||||||||||||||||
This structure is used to store the
information about a drive and could by accessed using the
default property Data.
|
||||||||||||||||||||||||
Limitations:
Currently none.
History:
V1.0: | First published release. |
V1.01: | - Required compiler options inserted to
avoid problems with global compiler settings different to
the Delphi4 default settings. - If the volumeID contains spaces, then the property PrettyName contains only the first part of the volumeID. |
V1.1: | New field LongPrettyName and method GetLongPrettyName. |