Condividi:
Problemi di HTML? Di PHP, ASP, .NET, JSP, Perl, SQL, JavaScript, Visual Basic..?
Vuoi realizzare programmi in C, C++, Java, Ruby o Smalltalk, e non sai da che parte cominciare?
Entra qui e troverai le risposte!
Moderatori: Anthony47, Triumph Of Steel, archimede
di Alexsandra » 29/04/06 13:39
Per correttezza posto il sorgente di un file exe consigliato ad un utente per utilizzarlo come da titolo
- Codice: Seleziona tutto
Option Explicit
Private Type MCI_OPEN_PARMS
dwCallback As Long
wDeviceID As Long
lpstrDeviceType As String
lpstrElementName As String
lpstrAlias As String
End Type
Private Const MCI_OPEN = &H803
Private Const MCI_OPEN_TYPE = &H2000&
Private Const MCI_SET = &H80D
Private Const MCI_SET_DOOR_OPEN = &H100&
Private Const MCI_SET_DOOR_CLOSED As Long = &H200&
Private Const MCI_CLOSE = &H804
Private Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As Long, ByRef dwParam2 As Any) As Long
Private openParams As MCI_OPEN_PARMS
Private Sub Form_Load()
openParams.wDeviceID = 0
openParams.lpstrDeviceType = "cdaudio"
Call mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE, openParams)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call mciSendCommand(openParams.wDeviceID, MCI_CLOSE, 0, ByVal 0&)
End Sub
Private Sub cmdApriCD_Click()
Call mciSendCommand(openParams.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, ByVal 0&)
End Sub
Private Sub cmdChiudiCD_Click()
Call mciSendCommand(openParams.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, ByVal 0&)
End Sub
-
![Avatar utente](./download/file.php?avatar=19253_1333237856.png)
Alexsandra
- Utente Senior
-
- Post: 2358
- Iscritto il: 09/01/06 20:31
Torna a Programmazione
Topic correlati a "[VB6] Sorgente per apri/chiudi CD":
Chi c’è in linea
Visitano il forum: Nessuno e 4 ospiti