DVD,VCD or audio CD ???

Hello,

Is there a way to find out whether there is a DVD, VCD or audio CD in the CD drive by using delphi 5.0?

Thank you for your help.
Totok
totokAsked:
Who is Participating?
 
KFZConnect With a Mentor Commented:
the DVD cd's has a "Video_ts" and an "Audio_ts" folder in the root, so you can just search if these folders exists
0
 
ginsonicCommented:
For audio CD:

function IsAudioCD(CDDrive : Char) : boolean;

var
  VolumeName, DrivePath : string;
  MaximumComponentLength, FileSystemFlags : DWORD;

begin
  DrivePath := CDDrive + ':\';
  Result := FALSE;

  if (GetDriveType(PChar(DrivePath)) = DRIVE_CDROM) then
    begin
      SetLength(VolumeName, 64);
      GetVolumeInformation(PChar(DrivePath), PChar(VolumeName), Length(VolumeName), nil, MaximumComponentLength,
                                          FileSystemFlags, nil, 0);

      if (lStrCmp(PChar(VolumeName),'Audio CD') = 0) then Result := TRUE;
    end;
end;

0
 
ginsonicCommented:
The VCD format requires specific folders and files and the DAT. So search if exist these folders and the DAT.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ginsonicCommented:
KFZ, we have here at Ex-Ex a golden 'rule' :) We don't put a directly answer, just comments . How you can see I answer to 2/3 from the question and I put just comments(your answer solve just 1/3).
This way let the asker to choice the better solution for him.

Totok can accept anytime a comment as answer.

Regards,
Nick
0
 
KFZCommented:
sorry im new as an expert, so i just wrote, and did'nt see that i should choose between answer or comment
0
 
totokAuthor Commented:
Thank you for the answers.

<KFZ, we have here at Ex-Ex a golden 'rule' :) We don't put <a directly answer, just comments . How you
<can see I answer to 2/3 from the question and I put just <comments(your answer solve just 1/3).
Ginsonic right about this. But I can not reject KFZ's answer, because he gave a valid answer too. Btw, since KFZ's is a new expert, I think I will give the point to him as a welcome.

Again thank you for your help.
0
 
ginsonicCommented:
No problem for points :) I have a lots .
Hope to help you my comments, too.
0
 
ginsonicCommented:
BTW, not particular for this case ... but when you wish ( multiple good answers ) you can split the points to experts number that you wish .
0
All Courses

From novice to tech pro — start learning today.