CD Open

13 Dec

#include <GUIConstants.au3>

$Drive = ""
GUICreate("Drive Tool by Joe. R", 240, 40)

$n1=GUICtrlCreateCombo ("", 7, 10, 40)
$var = DriveGetDrive( "CDROM" )

$all=""
For $i = 1 to $var[0]
    $all = $all & $var[$i] & "|"
Next

GUICtrlSetData(-1, $all, $var[1])

$OpenID  = GUICtrlCreateButton("Open", 60, 10, 50, 20)
$CloseID = GUICtrlCreateButton("Close", 120, 10, 50, 20)
$ExitID = GUICtrlCreateButton("Exit", 180, 10, 50, 20)

GUISetState ()       ; will display an empty dialog box with a combo control with focus on

Do
 $msg = GUIGetMsg()
        $Drive = GUICtrlRead($n1)
 Select
  Case $msg= $OpenID
   CDTray($Drive, "open")
  Case $msg= $CloseID
   CDTray($Drive, "close")
 EndSelect

Until $msg = $GUI_EVENT_CLOSE or $msg = $ExitID

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: