Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This is a simple easy to use 2 button program. Ope...
Author:
Kevin Sandsloan
E-mail:
Click to e-mail author
Submitted:
4/18/2003
Version:
VB6
Compatibility:
VB6
Category:
Windows API
Views:
13978
This is a simple easy to use 2 button program. Open CDROM, Close CDROM, enjoy.
Declarations:
'none
Code:
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 Sub CDControl(action As Boolean) If action Then 'open the CDROM retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0) Else 'Close the CDROM retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0) End If End Sub Private Sub Command1_Click() CDControl True End Sub Private Sub Command2_Click() CDControl False End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement