如何在程序中打开和关闭光驱(100分)

  • 主题发起人 主题发起人 wtb
  • 开始时间 开始时间
W

wtb

Unregistered / Unconfirmed
GUEST, unregistred user!
如何在程序中打开和关闭光驱
 
uses
MMSystem;
To open the CD-ROM:
--------------------------------------------------------------------------------
mciSendString('Set cdaudio door open wait', nil, 0, handle);
--------------------------------------------------------------------------------
To close the CD-ROM:
--------------------------------------------------------------------------------

mciSendString('Set cdaudio door closed wait', nil, 0, handle);

--------------------------------------------------------------------------------
CD-ROM drive; returns 0 if successfull }
 
; below is example for how to open & close CD-ROM drive.

'Private Declare Function mciSendString Lib "winmm.dll" Alias_
"mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString
As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long


'Open CD drive door
retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)

'Close CD drive door
retvalue = mciSendString("set CDAudio door closed", returnstring, 127,0)
 
没有什么好写的了!都写出来了!!
 
可以了,再写就是自己写系统了,,
 
多人接受答案了。
 
后退
顶部