Icon to open cd drive
#1 OFFLINE
Posted 30 May 2005 - 04:17 AM
#2 OFFLINE
Posted 30 May 2005 - 02:52 PM
rridgely, on May 30 2005, 12:17 AM, said:
#3 OFFLINE
Posted 30 May 2005 - 03:12 PM
#4 OFFLINE
Posted 30 May 2005 - 04:08 PM
rridgely, on May 30 2005, 11:12 AM, said:
#5 OFFLINE
Posted 30 May 2005 - 04:35 PM
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.
#6 OFFLINE
Posted 30 May 2005 - 06:59 PM
#7 OFFLINE
Posted 30 May 2005 - 07:29 PM
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
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.
DjLizard.net
DjLizard.net wiki
Dial-a-fix
Dial-a-fix tips
DjLizard.net software support forum
Do you live in Bradenton, Sarasota, Tampa, or St. Petersburg, Florida? Visit Digital Doctors where I work :)
#8 OFFLINE
Posted 30 May 2005 - 07:34 PM
DjLizard, on May 30 2005, 03:29 PM, said:
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
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.
#9 OFFLINE
Posted 30 May 2005 - 07:38 PM
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
DjLizard.net
DjLizard.net wiki
Dial-a-fix
Dial-a-fix tips
DjLizard.net software support forum
Do you live in Bradenton, Sarasota, Tampa, or St. Petersburg, Florida? Visit Digital Doctors where I work :)
#10 OFFLINE
Posted 30 May 2005 - 07:47 PM
#11 OFFLINE
Posted 30 May 2005 - 07:50 PM
DjLizard.net
DjLizard.net wiki
Dial-a-fix
Dial-a-fix tips
DjLizard.net software support forum
Do you live in Bradenton, Sarasota, Tampa, or St. Petersburg, Florida? Visit Digital Doctors where I work :)
#12 OFFLINE
Posted 30 May 2005 - 07:58 PM
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.
DjLizard.net
DjLizard.net wiki
Dial-a-fix
Dial-a-fix tips
DjLizard.net software support forum
Do you live in Bradenton, Sarasota, Tampa, or St. Petersburg, Florida? Visit Digital Doctors where I work :)
#13 OFFLINE
Posted 30 May 2005 - 08:14 PM
#14 OFFLINE
Posted 30 May 2005 - 08:30 PM
#15 OFFLINE
Posted 30 May 2005 - 08:36 PM
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,
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
DjLizard.net
DjLizard.net wiki
Dial-a-fix
Dial-a-fix tips
DjLizard.net software support forum
Do you live in Bradenton, Sarasota, Tampa, or St. Petersburg, Florida? Visit Digital Doctors where I work :)
#16 OFFLINE
#17 OFFLINE
Posted 31 May 2005 - 03:19 PM
Eldmannen, on May 31 2005, 08:40 AM, said:
Yes, but that only opens it and thats not what my problem was. I needed something to close it too.
#18 OFFLINE
Posted 31 May 2005 - 03:21 PM
rridgely, on May 31 2005, 11:19 AM, said:
#19 OFFLINE
Posted 31 May 2005 - 03:28 PM
Tarun, on May 31 2005, 11:21 AM, said:
He sure did. In my quick launch I have two cd icons one opens the drive and the other closes it.
















