Jump to content
CCleaner Community Forums
Sign in to follow this  
rridgely

Icon to open cd drive

Recommended Posts

Is their a way to make an icon that will open and close your cd rom drive? The way my pc's case is you cant close the cd drive with the button you can only open it with it (it has some kind of spring door thing in front of it). Well my pc has a dual layer dvd burner in it and I really dont want it to get broken being closed by hand.

Share this post


Link to post
Share on other sites
Is their a way to make an icon that will open and close your cd rom drive? The way my pc's case is you cant close the cd drive with the button you can only open it with it (it has some kind of spring door thing in front of it). Well my pc has a dual layer dvd burner in it and I really dont want it to get broken being closed by hand.

 

 

 

The button doesn't respond to being pressed for closing it..?

Share this post


Link to post
Share on other sites

No the button on the drive works fine, but I can only open the drive with it and I have to actually push the drive in a little bit to close it, becuase the door over the drive flips down and blocks the button. The door over the drive has a button on that just pushes the one on the drive itself to open.

Share this post


Link to post
Share on other sites
No the button on the drive works fine, but I can only open the drive with it and I have to actually push the drive in a little bit to close it, becuase the door over the drive flips down and blocks the button. The door over the drive has a button on that just pushes the one on the drive itself to open.

 

 

 

Does it flip down in a loose way? If so you can just raise it a little and press the button.

Share this post


Link to post
Share on other sites

Sorry Tarun I dont think I'm explaining what I'm trying to do very well.. This is the type of case my pc has: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewI...5201798907&rd=1

its a picture of one on ebay not my actual pc.

 

You see how the cd drives are covered. well you can open it by pushing the button but once its open the button is covered so you have to manually push the drive a little in order for it to close(stupid desighn that I didnt notice till I bought it). I want to create an icon in my quick launch bar that can open and close the cdrom drive so I dont have to wory about pushing the drive to hard and breaking it.

Share this post


Link to post
Share on other sites

Here is a tool:http://www.cd-eject-tool.com/ Have to pay after trial. There are probably some free ones around.

Share this post


Link to post
Share on other sites

Nah don't bother with that....

I made a small program for you.

 

http://djlizard.net/cdtray.exe

 

Send it commands like:

cdtray.exe open D:

cdtray.exe close E:

 

It can't [yet] tell if a drive is already open or closed, so you have to send it the right command. If you REALLY want me to, I'll try to figure it out ;) (or you could just always manually open it, but use cdtray.exe to close it)

 

Oh and you have a very valid point about not wanting to push the drive back in by hand. It can wreak havoc on the treads and gears with each little push on the tray.

Share this post


Link to post
Share on other sites
Nah don't bother with that....

I made a small program for you.

 

http://djlizard.net/cdtray.exe

 

Send it commands like:

cdtray.exe open D:

cdtray.exe close E:

 

It can't [yet] tell if a drive is already open or closed, so you have to send it the right command.  If you REALLY want me to, I'll try to figure it out ;) (or you could just always manually open it, but use cdtray.exe to close it)

 

Oh and you have a very valid point about not wanting to push the drive back in by hand.  It can wreak havoc on the treads and gears with each little push on the tray.

 

 

 

 

Thank you so much! I need help though, I downloaded it and a black box flashes and goes away I cant type cdtray.exe.

Share this post


Link to post
Share on other sites

Yeah it's a command line program.

 

You put the program somewhere, then make a shortcut to it...

 

So you right click somewhere, new, shortcut, then you browse, point at cdtray.exe, then it makes a long string of the path and exe that has quotes around it... well OUTSIDE the quotes, you put the parameters.. for example, if your shortcut looked like:

"C:\windows\system32\cdtray.exe"

 

You'd change it to say

"C:\windows\system32\cdtray.exe" open D:

 

and hit next, and the shortcut wizard will then always send that command when you use that shortcut. You could name the shortcut CLOSE D DRIVE. You could even make the shortcut from inside of the quick launch folder (right click in a blank area of your quick launch toolbar and choose Open Folder, then make the shortcut in there).

 

I recommend putting cdtray.exe in C:\windows\system32

 

 

It's not PRETTY looking, but it could be if I spent more than 5 minutes coding it after reading your post ;)

Share this post


Link to post
Share on other sites

I got it to work, I put a cd icon on it and stuck it in my quick launch. Thanks alot that is the coolest thing to be able to just want to write a program and do it.

Share this post


Link to post
Share on other sites

the source (object pascal) :

 

 

program ejectcd;{$APPTYPE CONSOLE}uses SysUtils, MMSystem;var str, str2: string;begin if (ParamCount < 2) then halt; str := lowercase(trim(ParamStr(1))); str2 := 'open cdaudio!' + uppercase(trim(ParamStr(2))) + ' alias thedrive'; mciSendString(PAnsiChar(trim(str2)), nil, 0, 0); if (str = 'close') then mciSendString('set thedrive door closed wait', nil, 0, 0); if (str = 'open') then mciSendString('set thedrive door open wait', nil, 0, 0);end.

 

Share this post


Link to post
Share on other sites

Ok, DjLizard I'm impressed by that program. I'm curious how you learned to do that and what other types of programs youve written.

Share this post


Link to post
Share on other sites

Somehow, I knew it would, that's why I posted the source. What you see above is the beauty of Pascal!

 

Now, that source is pretty nasty - no checking ANYWHERE (but you can't really screw it up with bad params anyway)) - and I could have made it toggle your tray (instead of needing explicit 'open'/'close') but I don't understand mci API yet. I looked it up to do this project, and I was like WTF. But Win32 API is pretty damn cool in general.

 

I learned Borland's version of Object Pascal with integrated editor -- Delphi -- in like 5 minutes. I already knew Borland's version of Pascal (specifically, Turbo Pascal 7) which ROCKED MY SOCKS when I was 15. Pascal, Delphi, Object Pascal... they're all so easy. They make sense, they promote stable, structured code, and they are strongly typed (i.e., "wordy") and are easy to read, and are usually pretty easy to figure out. The above was kinda hard to read because Win32 API is none of those things.

 

I've written several other programs, including:

Tarun's Hijack this Converter - his first version was Visual Basic, and I ported it to Delphi in 48 hours (having not known Visual Basic (at all!), about two weeks of casual Delphi, and obviously not working on it for 48 straight hours) - I did it as an exercise and an example : A) I needed to learn Delphi and had nothing to program, no good ideas, and, B) I wanted to show Tarun how impressive Delphi is, and how fast you can learn it. I figured it'd be good if he learned Delphi using his own program. He's been updating the source ever since.

 

The Digital Doctor: a specialized program used on my Tech CD as an interface to the installation and launching of hundreds of tricks and programs. -- ongoing, private, proprietary, and closed-source

 

Dial-a-fix: a program which can fix a couple dozen 'known-issues', and can automate the installation or repair of several Windows-critical services (windows installer, windows update automatic update, cryptography service, etc etc) -- ongoing, public, and closed-source (current build's always at - http://djlizard.net/daf.exe) -- ("supporting" files not yet uploaded, but they will be at http://djlizard.net/daf/ when I get a chance)

 

and a few odds and ends for my family (Nessa's Calendar - low code, mostly form properties -- it's just a Delphi MonthCalendar(ComCtls) component)

 

oh, I made a secure shredder program (and DLL) that I was going to show MrG, to possibly wring CCleaner's found files through. I'm not sure if A) it works well (seems to work fine here, but I haven't wrung thousands of junk files through it like CCleaner would) and B) if it's fast enough, etc) so I haven't really opted to show it to him yet ;)

Share this post


Link to post
Share on other sites

You can right-click on the CD/DVD drive, and select "Eject".

Share this post


Link to post
Share on other sites
Yes, but that only opens it and thats not what my problem was. I needed something to close it too.

 

 

 

From what I can tell, DjLizard did a very professional fix for you too. :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...