Judging whether the drive is ready, such as floppy disk, optical drive function 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;
Call example:
IF not isdiskready ('a') Then ShowMessage ('Drive A: Not ready ") Else ShowMessage (' Drive A: Ready");
Pop back or close the CD-ROM function (to join the MMSystem unit)
Procuere Eject (Yesorno: Boolean); Begin if Yesorno Then McIndstring ('Set Cdaudio Door Open Wait', NIL, 0, Handle) Else McIndstring ('Set Cdaudio Door Closed Wait', NIL, 0, Handle);