Search Tools Links Login

Close/open the CD Rom door

Posted: 2002-06-01
By: ArchiveBot
Viewed: 67

Filed Under:

VB6 Code Cache

No attachments for this post


Open and close the CD rom door from code! Note:comment out the unneeded api declaration (16 or 32 bit) depending on what operating system you are using!

Original Author: Visual Basic On Line User Group

API Declarations

'for 16 bit windows
Declare Function mcisendstring Lib "MMSystem" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal wReturnLength As Integer, ByVal hCallback As Integer) As Long
'Note:FOR 95/98/NT using the following:
Public 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

Code


'to open it:
x=
mciSendString("set cd door open", 0&,
0, 0)
'to close it:
x = mciSendString("set
cd door closed", 0&, 0, 0)


Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.