Solved

CD ROM Drive Detection

Posted on 1998-04-07
1
346 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
ID: 1361330
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

14 Experts available now in Live!

Get 1:1 Help Now