Solved

Delphi Programming question

Posted on 1997-07-01
1
173 Views
Last Modified: 2010-04-04
Hello,I want to get a list of available drives, preferabily with drive types with delphi 2.0.I have found the relevent API calls but was wondering if there was an delphi function call to do this?
0
Comment
Question by:essbb
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 60 total points
ID: 1338057
There is _no_ native Delphi call that does what you want.
The API-command works really fine, something like this:

  for DriveChar := 'A' to 'Z' do begin
    DriveType := GetDriveType(PChar(DriveChar+':\'));
    if DriveType>1
    then begin
      case DriveType of
        DRIVE_REMOVABLE : begin {Add to list here} end;
        DRIVE_FIXED     : begin {Add to list here} end;
        DRIVE_REMOTE    : begin {Add to list here} end;
        DRIVE_RAMDISK   : begin {Add to list here} end;
        DRIVE_CDROM     : begin {Add to list here} end;
      end;
    end else {This drive doesn't exist};
  end;

This will work on the logical drives 'A:'-'Z:', but not on
the unconnected "network" shares '\\server\share'.
For that you need another approach.

Hope this helps!

/// John

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question