Solved

CD ROM Drive Detection

Posted on 1998-04-07
1
345 Views
Last Modified: 2012-05-04
How do I detect a users CD ROM drive ?
0
Comment
Question by:jcoulter
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 50 total points
Comment Utility
Hi

The following function will return the CDRom Drive string (e.g. E:\) for the first CDROM on the system.  An empty string means that the system doesn't have a CDROM installed.

function GetCDRomPath: string;
var
  i: Integer;
  Drives: DWORD;
begin
  Result := '';
  Drives := GetLogicalDrives;
  for i := 0 to 25 do
    if ((Drives and (1 shl i)) > 0) and (GetDriveType(PChar(Chr(65 + i) + ':\')) = DRIVE_CDROM) then
      begin
        Result := Chr(65 + i) + ':\';
        Break;
      end;
end;


Regards,
JB
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

8 Experts available now in Live!

Get 1:1 Help Now