Hi
Today im going to teach you how to open your pc CD or DvD tray by pressing 1 button and second button to close.
Open a new project and go to tools and drag 2 buttons.
1 button - call it " Open "
2 button - call it " Close "
Now put this code:
[vb]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[/vb]
Then double click on the button " Open " and put this code:
[vb]mciSendString("Set CDAudio Door Open Wait", 0&, 0&, 0&)[/vb]
Then double click on the button " Close " and put this code:
[vb] mciSendString("Set CDAudio Door Closed Wait", 0&, 0&, 0&)[/vb]
If you got any problem with the source that i have gave here please contact me via pm and i will reply as soon as possible.
Thank you
Today im going to teach you how to open your pc CD or DvD tray by pressing 1 button and second button to close.
Open a new project and go to tools and drag 2 buttons.
1 button - call it " Open "
2 button - call it " Close "
Now put this code:
[vb]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[/vb]
Then double click on the button " Open " and put this code:
[vb]mciSendString("Set CDAudio Door Open Wait", 0&, 0&, 0&)[/vb]
Then double click on the button " Close " and put this code:
[vb] mciSendString("Set CDAudio Door Closed Wait", 0&, 0&, 0&)[/vb]
If you got any problem with the source that i have gave here please contact me via pm and i will reply as soon as possible.
Thank you