delphi - How to display label of unnamed drive? -


I have to get label of a name or drive.

I use this function:

Function GetVolumeLabel (DriveChar: Char): string; Var NotUsed: DWORD; Volume flags: DWORD; Volumebook: The array of letters [0..MAX_PATH]; Volume-serial Number: DWOD; Buf: Sir [0..MAX_PATH] sir; Start GetVolumeInformation (PCR (+ Driver: ':' '), Buff, Sizeoff (VolumeInfo), @ Volume Serial Number, Notes, Volume Flag, Zero, 0); Setstring (results, buff, strollen (buff)); {Set the result of return} Results: = End of case (results) on Ansari; For example, here are my drives in Windows Explorer:
  Local disk (C :) data (D :) DVD RW drive (E:)  

Code Output:

  C: D: Data E:  

Label labeled C and E are empty Anonymous Drive (C & E) label What do I need to do / have Function to display?

I believe the use of "local disk" and "DVD RW drive" for placeholder Used when a volume label does not:

A label is a user friendly name that is assigned to a quantity, usually by the end user, making it easier to identify . A volume can contain labels, one drive letter, both or neither.

Not sure that it helps, but you want to use and generate labels based on the return value. While GetDriveType differentiates between hard drives, removable drives and CD type drives, I do not think this is different between CD-ROM / CD-RW / DVD-ROM / DDR-RW drives.

/ html>

Comments