hey all!!!I need a little help Toopen

lmb2001
10-08-2001, 06:30 PM
I want to make a desktop EXE to open the CD drive b/c my comp setup is wierd..the tower is on the floor and When i open it by hand the drawer opens and gets in the way of the button.How do I programmically open the cd rom drive?

==============
?¿-=The Bomb=-¿?
"You all stare, but you'll never see; theres something inside me!"

dcl3500
10-08-2001, 06:36 PM
Not sure about this never having used it but the Microsoft Multi-media control has an eject method I believe.

Don

Time is the best teacher; unfortunately it kills all its students.

JDT
10-08-2001, 06:39 PM
Try this with a command button:

<pre><font color=blue>Option Explicit</font color=blue>

<font color=blue>Private <font color=blue>Declare</font color=blue> Function</font color=blue> mciSendString <font color=blue>Lib</font color=blue> "winmm.dll" <font color=blue>Alias</font color=blue> "mciSendStringA" ( _
<font color=blue>ByVal</font color=blue> lpstrCommand <font color=blue>As String</font color=blue>, _
<font color=blue>ByVal</font color=blue> lpstrReturnString <font color=blue>As String</font color=blue>, _
<font color=blue>ByVal</font color=blue> uReturnLength <font color=blue>As Long</font color=blue>, _
<font color=blue>ByVal</font color=blue> hwndCallback <font color=blue>As Long</font color=blue>) <font color=blue>As Long</font color=blue>

<font color=blue>Private Sub</font color=blue> Command1_Click()

<font color=blue>Static</font color=blue> bln <font color=blue>As Boolean</font color=blue>

<font color=blue>If</font color=blue> bln = <font color=blue>False Then</font color=blue>
mciSendString "set CDAudio door open", 0&, 0, 0
<font color=blue>Else</font color=blue>
mciSendString "set CDAudio door closed", 0&, 0, 0
<font color=blue>End If</font color=blue>

bln = <font color=blue>Not</font color=blue> bln

<font color=blue>End Sub</font color=blue></pre>



JDT

dcl3500
10-08-2001, 06:46 PM
Cool JDT, I thought there was an API call for it but darned if I could figure what it was. images/icons/smile.gif

Don

Time is the best teacher; unfortunately it kills all its students.

lmb2001
10-08-2001, 08:01 PM
thanks every one!!!

==============
?¿-=The Bomb=-¿?
"You all stare, but you'll never see; theres something inside me!"

orufet
10-08-2001, 08:17 PM
Just a comment.....

This is a feature of many trojan horse programs (so I've been told), and many other questions you've asked have also been a little edgy. I'm not accusing you of trying to write a trojan, but remember that if that's what you're doing, please don't ask questions here....

Oh, by the way, to close the CD ROM drive, usually you can just press in on it, and it closes....http://www.visualbasicforum.com/bbs/images/icons/wink.gifhttp://www.visualbasicforum.com/bbs/images/icons/wink.gif Sorry, I just don't buy that excuse.

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

ChiefRedBull
10-09-2001, 02:53 AM
At least he's being creative with his excuses'! LoL. And opening someones CD drive is harmless enough.

Chief

"How are we to learn, if those that know will not teach... ?" - Me.

orufet
10-09-2001, 08:18 AM
I agree, it is harmless. Just a hint ofhis project, though

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

Squirm
10-09-2001, 08:22 AM
His original post states quite clearly that the purpose of this project is solely for opening and closing the CD drive:

I want to make a desktop EXE to open the CD drive b/c my comp setup is wierd..the tower is on the floor and When i open it by hand the drawer opens and gets in the way of the button.

There - he wants a desktop EXE which he can click on to open and close the CD drawer, a mighty useful utility I should think. I know we need to be careful of hackers, but I think we forget how frustrating it would be if our questions were considered dodgy and therefore never got answered. Cut people a little slack.

JDT
10-09-2001, 11:00 PM
All,

This question was in no way a violation of the rules. It has even been asked and answered a couple times before. This site is all about helping with VB so if the question is legitimate, then all current members have the right to ask.


Thread Closed


JDT

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum