Recently someone asked for it so I'm just gonna post the source here.
I include snippets for:
- Open or close CD Drive
- Opening and Closing without stopping (Loop)
Open or close the CD Drive
It opens the CD Drive (when it's closed) or closes the CD Drive (when it's opened). You only use the red code.
Note: The closing doesn't works on laptops.
Looping it (Spam opening and Closing)
To loop it you use the green and the red code together.
-=-=-=-=-=-=-=-=-=-=-=-=-
Public Sub eject()
Do
Dim owmp As Object
Dim colCDROMs
owmp = CreateObject("WMPlayer.OCX.7")
colCDROMs = owmp.cdromCollection
If colCDROMs.Count >= 1 Then
For i = 0 To colCDROMs.Count - 1
colCDROMs.Item(i).eject()
Next
For i = 0 To colCDROMs.Count - 1
colCDROMs.Item(i).eject()
Next
End If
Loop
End Sub
-=-=-=-=-=-=-=-=-=-=-=-=-
How to use it:
I include snippets for:
- Open or close CD Drive
- Opening and Closing without stopping (Loop)
Open or close the CD Drive
It opens the CD Drive (when it's closed) or closes the CD Drive (when it's opened). You only use the red code.
Note: The closing doesn't works on laptops.
Looping it (Spam opening and Closing)
To loop it you use the green and the red code together.
-=-=-=-=-=-=-=-=-=-=-=-=-
Public Sub eject()
Do
Dim owmp As Object
Dim colCDROMs
owmp = CreateObject("WMPlayer.OCX.7")
colCDROMs = owmp.cdromCollection
If colCDROMs.Count >= 1 Then
For i = 0 To colCDROMs.Count - 1
colCDROMs.Item(i).eject()
Next
For i = 0 To colCDROMs.Count - 1
colCDROMs.Item(i).eject()
Next
End If
Loop
End Sub
-=-=-=-=-=-=-=-=-=-=-=-=-
How to use it:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call eject()
End Sub

5:52 AM
Unknown
Posted in: 
0 comments:
Post a Comment