Solved

Delphi Programming question

Posted on 1997-07-01
1
159 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now