判断驱动器是否准备好,如软盘,光驱的函数
  function IsDiskReady(Drive: char): boolean;
  var
    d1, d2, d3, d4: longword;
    DrivePath: array [0..3] of char;
  begin
    DrivePath := :;
    DrivePath[0] := Drive;
    Result := GetDiskFreeSpace(DrivePath, d1, d2, d3, d4);
  end;

调用例子:

  if not IsDiskReady(A) then
    ShowMessage(驱动器 A: 未准备好)
  else showmessage(驱动器 A: 准备好);

弹出或关闭cd-rom 函数(要加入  MMSystem 单元)

procduere Eject(YesOrNo: Boolean);
begin
  if YesOrNo then
    mciSendstring(SET CDAUDIO DOOR OPEN WAIT,nil,0, Handle)
  else mciSendstring(SET CDAUDIO DOOR CLOSED WAIT,nil,0, Handle);
end;