N
nzfboy
Unregistered / Unconfirmed
GUEST, unregistred user!
我已经可以开了,但无法关闭。请大家看一下,我把开的代码拿出来。如下:<br>function EjectCD(Drive : char) : bool;<br>var<br> mp : TMediaPlayer;<br>begin<br> result := false;<br> Application.ProcessMessages;<br> //if not IsDriveCD(Drive) then exit;<br> mp := TMediaPlayer.Create(nil);<br> mp.Visible := false;<br> mp.Parent := Application.MainForm;<br> mp.Shareable := true;<br> mp.DeviceType := dtCDAudio;<br> mp.FileName := Drive + ':';<br> mp.Open;<br> Application.ProcessMessages;<br> mp.Eject;<br> Application.ProcessMessages;<br> mp.Close;<br> Application.ProcessMessages;<br> mp.free;<br> result := true;<br>end;<br>注意:use mplayer