A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
CD Drive ControlEnumerates all CD-ROM drives and allows them to be opened and closed at the touch of a button. |
On Wednesday, April 7th 2004 at 10:45 PM By Sean Eshbaugh (View Profile) ![]() ![]() ![]() ![]() (Rated 4.8 with 16 votes) |
||
|
I got bored the other day and was looking through the Platform SDK Documentation and came across the DeviceIoControl API function. I came upon the IOCTL_STORAGE_EJECT_MEDIA control code and it got my interest. I decided to make a small application that made use of DeviceIoControl and the IOCTL_STORAGE_EJECT_MEDIA and IOCTL_STORAGE_LOAD_MEDIA control codes.
Add the above functions to the end of the source file for the dialog and #include stdio.h and winioctl.h in the stdafx.h file. |
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current CommentsHello, By any chance do you know how to open the cd drive with Java programming. I am doing this project for my Computer Science class and i will apreciate it if you could tell me ow or knew anybody that could help me. I got another programm but it doesnt get it in java. It says that win32 does not exist. I will really appreciate it if you could help me. Thanks
damn, the downloadable source doesnt work!! THE ZIPFILE IS CORRUPTED!
The zipfile is no longer there!!! Please fix the link.
Thank you very much Mr. Sean For The good work you are diong and trying to explore to the public.As per the work I, i dont have any much option to the project appreciate whatever it's all about.I too have some taskful programs to be handled though i yet dont have a supportive link tosolving the proble.Please E-mail me so that i can be sure that my e-mail went through your script.Enjoy
Thanks! It is beautiful code. And how can I catch an event that eject or inject of my removable disk was occured?
Im working on programming at tech school and i was wondering if well you could help me with some c++ programming. I am using it on linux so some of the windows types might not work but here goes.
I need to be able to write a program that takes 10 numbers puts them into a file then pules 10 more back out can you give me help just email me.
hai hello this is verry helped me to understand about CD
Dir Sir , I can not download the source of program, please sent me another?
thanks you very much.
Hi- I am trying to figure out how to make my cd-rom drive open and or close using c++ (.net) could you give me a hand? Thanks
(smithju@gmail.com)
how can we do this in java?Are there any built in classes.
If you can help please mail me.
This snippet of code works fine. Good work Sean!
@jeet: Sorry, there is no native Java support for devices like a CD-ROM, because Java might be run on a system without any ejectable device (Cell phone, PDA, ect.). The only solution is to program a native DLL in Windows and use the JNI (Java Native Interface) technology to access such core functions of Windows. Don\'t forget that this solution will not be portable to Linux or Mac.
hi!
i tried the code in the 2005 version (visual 8), and i get some errors... is there any way you cand write another code that works on visual 8 too? please...
anyways... the program is great and easy to understant.
thank you
I doing a project about eject cdrom by c(c++)
please send me source code about it
Thank you
How can we check the CDROM is eject or load??
you deserve the 5star rating. really made things easy to control the cd drive. thanks a lot
i doing program to open cd drive in C .
please send me source code.
Thanks.
Dir Sir,
Could you tell me the way to open the Audio/video settings wizard on the click of button ok. I had tried with uccapi.dll, but it worked on implmenting pc but unable to open the page on other pc when installed the application on other pc and gives error "Error CoCreateInstance".
Thanx in Adv.
Hi Sean
I don't know if I'm 4 years too late and whether you still monitor this page, but I'm looking for a sequence of code that allow me to manipulate the speed at which the laser will track back and forth. I'm trying to build a film surface scanner for uni and thought that the mechanism thats in so many old broken cdrom drives would do the job.
Anyway if you or any others that view this post have any ideas of how to hack the controller and make this possible I'd love to hear.
Cheers
Mark
Hi Sean
I don't know if I'm 4 years too late and whether you still monitor this page, but I'm looking for a sequence of code that allow me to manipulate the speed at which the laser will track back and forth. I'm trying to build a film surface scanner for uni and thought that the mechanism thats in so many old broken cdrom drives would do the job.
Anyway if you or any others that view this post have any ideas of how to hack the controller and make this possible I'd love to hear.
Cheers
Mark
hai friends i want know that how to injuct a cd drive without touch it physiclly.... if you have any idea about this you just send me a reply ya.....
Howz u guyz, need assistance in c . I only can code n executte the black screen, n am interested in window based screen shots, how can i do this, n make even more powerful stable programs???????
Hi Mark,
I was just reading your post (from almost 2 years ago) I am working on a similar project with a CD Drive. I was wondering if you had any success with your idea and if you were able to control the speed of the CD drive.
Thanks,
Sam
Related Tutorials
Related Source Code
C++ Job Search