borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2013 Andrea Tincani
:: How to Open and Close CD gate

Author  

aromman

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
API Declarations
Option Explicit

'Declare
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
Module
'Module
Public Sub OpenCD()
    Dim res As Long, returnstring As String * 127
    res = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub

Public Sub CloseCD()
    Dim res As Long, returnstring As String * 127
    res = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub
Usage
'Usage
Private Sub Command1_Click()
    OpenCD
End Sub

Private Sub Command2_Click()
    CloseCD
End Sub
:: Navigation

Home

Files and Disks Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 10-01-2012 Re: Export to Excel from Access Error by GeoffS
icon 06-04-2007 database visual basic 2005 by eira_ak
icon 20-03-2007 Re: db data -->vb in one by one data (using text botton in vb) by aak_neo
icon 14-08-2006 Re: how to configure server for asp.net? by Bharathi
icon 24-04-2006 Re: Web Browser control by qwertypunk
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2013 Andrea Tincaniborder