Quick Search for:  in language:    
Open,close,door,from,code,Notecomment,unneede
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,014,970. lines
 Jobs: 119. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
CString v1.5
By Ultimatum on 7/2


Tablature Pro
By Michael McMullen on 7/2


Click here to see a screenshot of this code!MSN Password Decryptor
By Muhammad Sufyan Ansari on 7/2

(Screen Shot)

Mp3 Paker
By Michael McMullen on 7/2


Suppress Run Time Script Errors
By Nuclear_1000G on 7/2


Click here to see a screenshot of this code!List Maker
By KBM-00 on 7/1

(Screen Shot)

Web Update Checker
By knormalnight on 7/1


A*Beginners API*
By Michael Nipper on 7/1


source hog v1.1
By Robert Justason on 7/1


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Close/open the CD Rom door

Print
Email
 

Submitted on: 6/27/1997
By: Visual Basic On Line User Group  
Level: Beginner
User Rating: By 105 Users
Compatibility:VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 31272 times.
 
 
     Open and close the CD rom door from code! Note:comment out the unneeded api declaration (16 or 32 bit) depending on what operating system you are using!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Close/open the CD Rom door
' Description:Open and close the CD rom 

'     door from code! Note:comment out the unn
    '     eeded api declaration (16 or 32 bit) dep
    '     ending on what operating system you are 
    '     using!
' By: Visual Basic On Line User Group
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=432&lngWId;=1'for details.'**************************************

'to open it:
x= 
mciSendString("set cd door open", 0&, 
0, 0)
'to close it:
x = mciSendString("set 
cd door closed", 0&, 0, 0)


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/14/1999 6:04:00 PM:Chad Muska
This code works perfectly in VB3. No 
problems with it for me. Good code!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/17/1999 2:36:00 PM:Really Dumb Guy
it says it cant find MMSystem.dll 
Someone like tell me how to Make it so 
it does Find it please :) i will Make u 
a Graffic if i can get this dont 
www.dawgyman.com is my site
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/26/1999 8:01:00 PM:Kyz0r
Here is the correct code:
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
'to 
close it:
retvalue = 
mcisendstring("set CDAudio door 
closed", returnstring, 127, 0) 
'to 
open it:
retvalue = mcisendstring("set 
CDAudio door open", returnstring, 127, 
0)
This works...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/11/1999 12:39:00 AM:James
This code works fine in VB4 Pro
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/23/1999 5:42:00 PM:PaperMaker
TO PUT API COMMANDS INTO VB YOU 
MUST*:
Click Project Menu, select Add 
Module
Select Module in window that 
pops up.
Paste the API code right into 
the Module.
*This is how you do it in 
VB5 Ent
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/17/1999 11:22:11 AM:Jonathan
I have a question.  What API Calls 
could I use to find out the position of 
the CDRom door: open/closed?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/4/2000 9:50:36 AM:Cyberspacer5000@aol.com
i really want this thing to work but i 
must be doing it wrong i have vb4 32 
bit and it isn't working do I open it 
bye saying Private Sub 
Command1_Click()
("set cd door open", 
0&,
0, 0)
End Sub
? thats what i've 
been doin' and it didn't seem to work 
so if someone knows what i did wrong 
can you please e-mail me at 
Cyberspacer5000@aol.com and name it Re: 
the code
thanx
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/16/2000 1:09:36 AM:Chris
This code seems to work:
close 
it:
retvalue = mcisendstring("set 
CDAudio door closed", returnstring, 
127, 0) 
'to open it:
retvalue = 
mcisendstring("set 
CDAudio door 
open", returnstring, 127, 
0)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/15/2000 9:31:39 AM:Zbi
Ok ! Your code work, but
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/27/2003 6:33:12 AM:
I really like it!
but the problem 
is....
I got two CD-Rom drive.
how 
can I specify the drive 
to
open/close?
Can you please e-mail 
me at
drixpanday@yahoo.com, subject: 
vbcode
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/19/2003 5:33:55 PM:
How do i get this to work for VB6.0???
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.