Search results for 'GetDriveType'. 3 post(s) found.

  1. 2007/09/19 Detecting Drive Types
  2. 2007/09/10 Does my CD-ROM drive contain an audio CD?
  3. 2007/08/25 Get The Drive Type
2007/09/19 08:26

Detecting Drive Types


Here's how to get the types of drives on your computer:
//Note: you will need one button and
//one memo on your form, for this tip...
procedure TForm1.Button1Click(Sender: TObject) ;
var
  Drive: Char;
  DriveLetter: String[4];
begin
  for Drive := 'A' to 'Z' do
  begin
  DriveLetter := Drive + ':\';
  case GetDriveType(PChar(Drive + ':\')) of
   DRIVE_REMOVABLE:
    Memo1.Lines.Add(DriveLetter + ' Floppy Drive') ;
   DRIVE_FIXED:
    Memo1.Lines.Add(DriveLetter + ' Fixed Drive') ;
   DRIVE_REMOTE:
    Memo1.Lines.Add(DriveLetter + ' Network Drive') ;
   DRIVE_CDROM:
    Memo1.Lines.Add(DriveLetter + ' CD-ROM Drive') ;
   DRIVE_RAMDISK:
    Memo1.Lines.Add(DriveLetter + ' RAM Disk') ;
   end;
  end;
end;
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 03:48 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 12:47 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:40 delete

    moneyideas

2007/09/10 13:30

Does my CD-ROM drive contain an audio CD?


We can use the Windows API function GetDriveType() to test if the drive is a CD-ROM drive then use the Windows API function GetVolumeInformation() to test if the VolumeName is 'Audio CD'.

function IsAudioCD(Drive : char) : bool;
var
   DrivePath : string;
   MaximumComponentLength : DWORD;
   FileSystemFlags : DWORD;
   VolumeName : string;
begin
   Result := false;
   DrivePath := Drive + ':\';
   if GetDriveType(PChar(DrivePath))
   <> DRIVE_CDROM then exit;
   SetLength(VolumeName, 64) ;
   GetVolumeInformation(PChar(DrivePath),
                        PChar(VolumeName),
                        Length(VolumeName),
                        nil,
                        MaximumComponentLength,
                        FileSystemFlags,
                        nil,
                        0) ;
   if lStrCmp(PChar(VolumeName),'Audio CD') = 0
   then result := true;
end;



Usage:
procedure TForm1.Button1Click(Sender: TObject) ;
begin
  if not IsAudioCD('D') then
   ShowMessage('Not an Audio CD in drive D') ;
end;
Trackback 4 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/25 08:37 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/28 21:56 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 06:22 delete

    moneyideas

  4. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:38 delete

    moneyideas

2007/08/25 09:32

Get The Drive Type


Shows how to identify the type of the drive you are acessing.

procedure TForm1.Button1Click(Sender: TObject);
var
  typ:Integer;
  s: string;
begin
  s:='C:\';
  typ:=GetDriveType(PChar(s));
  if Typ <> 0 then case typ of
    DRIVE_REMOVABLE:
      begin
        ShowMessage('Drive Removable / Diskette');
      end;
    DRIVE_FIXED:
      begin
        ShowMessage('Drive fixed / Festplatte');
      end;
    DRIVE_CDROM:
      begin
        ShowMessage('CD ROM Drive');
      end;
    DRIVE_RAMDISK:
      begin
        ShowMessage('RAM Drive');
      end;
    DRIVE_REMOTE:
      begin
        ShowMessage('Remote Drive / Netzlaufwerk');
      end;
  end;
end;

Trackback 10 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject Buy vicodin online next day delivery.

    Tracked from Buy vicodin online. 2008/12/14 11:14 delete

    Forum vicodin buy vicodin online. Buy vicodin online next day delivery. Buy vicodin online. Buy vicodin online without a prescription. Buy vicodin online without.

  2. Subject Amoxicillin blood sugar.

    Tracked from Amoxicillin effects on a fetus. 2008/12/16 20:49 delete

    Amoxicillin clavulanate potassium. Amoxicillin. Amoxicillin for acne. Dosing of amoxicillin for sinus infection.

  3. Subject Amoxicillin order mexico mexican.

    Tracked from Amoxicillin orange suspension. 2008/12/17 17:23 delete

    Amoxicillin dosage. Amoxicillin price. Amoxicillin. Amoxicillin side effects. Buy amoxicillin online cheap amoxicillin. Amoxicillin yeast infection. Amoxicillin allergy itch.

  4. Subject Phentermine.

    Tracked from Lowest price for phentermine. 2008/12/17 18:05 delete

    Phentermine. Phentermine capsule. Phentermine side effects.

  5. Subject Valium.

    Tracked from Valium side effects. 2009/01/23 21:34 delete

    Valium blue 10mg. Valium picture.

  6. Subject Snorting adderall.

    Tracked from Adderall side effects. 2009/01/25 00:31 delete

    Buy adderall without a prescription. Adderall. Adderall 7.5.

  7. Subject What is clarinex-d.

    Tracked from Clarinex. 2009/03/28 04:37 delete

    Clarinex. Is clarinex better.

  8. Subject different money making ideas

    Tracked from moneyideas 2010/01/28 22:38 delete

    moneyideas

  9. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 06:50 delete

    moneyideas

  10. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:43 delete

    moneyideas