Jump to content

CD TRAY


Recommended Posts

If you explore that site a little you'll be able to find the source for that program, which you could analyze and then maybe come up with a way to do this in AutoIt. Emphasis on maybe. I'm just offering it as a suggestion.

Download the source from here:

http://sourceforge.net/project/showfiles.p...ckage_id=166050

Link to comment
Share on other sites

No problem.

I did try doing this once. I had it working so you could have hot keys which would lock or unlock the CD Tray, sometimes it would work but then you keep pressing and it doesn't..

yea I had it lock but I notice if I pushed it in it does the same thing. Ill keep playing with it

Link to comment
Share on other sites

Here is what I had:

HotKeySet("!^u", "_Unlock")
HotKeySet("!^l", "_Lock")
HotKeySet("1", "_Msg")
HotKeySet("{esc}", "_Esc")
#NoTrayIcon

$Lock = True

While $Lock = True
    CDTray("D:", "closed")
    $Lock = True
WEnd

While $Lock = False
    $Lock = False
WEnd

Func _Unlock()
    $Lock = False
EndFunc   ;==>_Unlock

Func _Lock()
    $Lock = True
    CDTray("D", "closed")
EndFunc   ;==>_Lock

Func _Esc()
    Exit
EndFunc   ;==>_Esc

Func _Msg()
    MsgBox(0, "CD Drive", $Lock)
EndFunc   ;==>_Msg

It's messy, but it could work if someone can be bothered.

Link to comment
Share on other sites

Here is what I had:

HotKeySet("!^u", "_Unlock")
HotKeySet("!^l", "_Lock")
HotKeySet("1", "_Msg")
HotKeySet("{esc}", "_Esc")
#NoTrayIcon

$Lock = True

While $Lock = True
    CDTray("D:", "closed")
    $Lock = True
WEnd

While $Lock = False
    $Lock = False
WEnd

Func _Unlock()
    $Lock = False
EndFunc   ;==>_Unlock

Func _Lock()
    $Lock = True
    CDTray("D", "closed")
EndFunc   ;==>_Lock

Func _Esc()
    Exit
EndFunc   ;==>_Esc

Func _Msg()
    MsgBox(0, "CD Drive", $Lock)
EndFunc   ;==>_Msg

It's messy, but it could work if someone can be bothered.

thanks nice picture :whistle:
Link to comment
Share on other sites

WTF - Damn ugly code there would eat all your CPU and you can only lock / unlock one time

While $Lock = True
    CDTray("D:", "closed")
    $Lock = True
WEnd

While $Lock = False
    $Lock = False
WEnd
Edited by Shevilie

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...