Sign in to follow this  
Followers 0
N30N3M3S1S

CD Tray opening script (my frist script in AutoIt)

4 posts in this topic

#1 ·  Posted (edited)

Here is the first creation I have made in AutoIt. Its a remake of a console I redefined in C++, I remade it in AutoIt as a program to use on my mIRC or whatever use I come to it. Ready to compile and run :) Made to be assigned to a hotkey in the Fkey row.

#include <GUIConstantsEx.au3>

$drives = DriveGetDrive("CDROM")
If Not @error Then
    CDTray("" & $drives[1], "open")
    $driveopen = $drives[1]
    Opt("GUIOnEventMode", 1)
    $mwin = GUICreate("CD Tray", 340, 80)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CloseIt")
    GUICtrlCreateLabel("CD Drive '" & $driveopen & "' is now open. Please place/remove disk and click OK.", 10, 10)
    $okb = GUICtrlCreateButton("OK", 125, 45, 80, 23)
    GUICtrlSetOnEvent($okb, "CloseIt")
    GUISetState(@SW_SHOW)
EndIf

While 1
    Sleep(1000)
WEnd

Func CloseIt()
    CDTray("" & $drives[1], "close")
    Exit
EndFunc

Also here is the alias I use to make work with mIRC. pressing F5 in mIRC makes it launch the program. (After compiling above snippet, compile as CDTray.exe and place in the mIRC directory if you want to use it with your mIRC too.)

alias F5 { run CDTray.exe }

Simple, eh?

Edited by N30N3M3S1S

Share this post


Link to post
Share on other sites



see _WinAPI_EjectMedia function in

Share this post


Link to post
Share on other sites

see _WinAPI_EjectMedia function in

Uhh...why?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Rather than saying "good job" he's showing you the already completed coding that someone else did lol. Not bad for a first project.


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
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
Sign in to follow this  
Followers 0