Whether the drive is ready, such as a floppy disk, the optical drive is also bounced, close the small example of CDROM

zhaozj2021-02-08  206

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);

转载请注明原文地址:https://www.9cbs.com/read-3209.html

New Post(0)