Solved

Delphi Programming question

Posted on 1997-07-01
1
177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Suggested Solutions

Title # Comments Views Activity
RESTRequest Parameter 4 81
Twebbrowser in Fire monkey android scrolling to bottom 1 86
Twebbrowser add css to the header 3 53
Delphi, TImage, Png 2 54
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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