Open CD Drive
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
Hello
This tutorial will tell you how to open and close CD Drive with a simple code.
Ok, so under public class <form name> add this code:
The project includes some images
that i got from the internet
Project Download Link: Codexvid
This tutorial will tell you how to open and close CD Drive with a simple code.
Ok, so under public class <form name> add this code:
Code: Select all
And then in your button click event or what ever you are using, add this to the click event:Private setTrayStatus As Long
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Code: Select all
My laptop doesn't close the CD Drive so i don't know if the close code works... i have to close the drive manually... 'use this code to open the tray
setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)
'use this code to close the tray
setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)
The project includes some images

Project Download Link: Codexvid
You do not have the required permissions to view the files attached to this post.
Last edited by Codex on Fri Aug 06, 2010 1:41 pm, edited 1 time in total.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
why not upload it here?
and thanks
and thanks
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

@Zachman61
Sure i will upload it here, if that makes any difference.
codexvid
Sure i will upload it here, if that makes any difference.
codexvid
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
well i just get to much spyware from megaupload and sites like it
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

thanks on the comments, glad u liked it.
@Zachman61 - then i will try to upload everything here.
@Zachman61 - then i will try to upload everything here.
Last edited by Codex on Sat Aug 14, 2010 3:31 pm, edited 1 time in total.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
I once made that kind of program on my previous computer (win7) and both opening AND closing worked...
<3 VB & Python
Copyright Information
Copyright © Codenstuff.com 2020 - 2023