bobheart Posted June 14, 2004 Share Posted June 14, 2004 expandcollapse popup;Generated with AutoBuilder 0.3 Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) GuiCreate("GBC Remote CDtray", 233,173,10,10,0x04CF0000) $label_1 = GUISetControl("label", "Remote CDtray ", 30,10, 120,20) $button_1 = GUISetControl("button", "Open", 30,90, 70,20) $button_2 = GUISetControl("button", "Close", 130,90, 70,20) $button_3 = GUISetControl("button", "Help", 30,130, 70,20) $button_4 = GUISetControl("button", "About", 130,130, 70,20) GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 Exit Case $msg = $label_1 ;;; Case $msg = $button_1 ;create an array with the drive letters D through Z: $driveArray = StringSplit("DEFGHIJKLMNOPQRSTUVWXYZ", "") For $i = 1 To 23;we have 23 elements in our array, so at most do this 23 times $opened = CDTray($driveArray[$i] & ":", "open") If $opened Then ExitLoop;it worked, so don't keep trying more drive letters Next If NOT $opened Then;it failed, so let the user know and exit MsgBox(0, "Failed", "Sorry, could not find a CD drive that would let me open it") Exit EndIf ;;; Case $msg = $button_2 ;create an array with the drive letters D through Z: $driveArray = StringSplit("DEFGHIJKLMNOPQRSTUVWXYZ", "") For $i = 1 To 23;we have 23 elements in our array, so at most do this 23 times $closed = CDTray($driveArray[$i] & ":", "close") If $closed Then ExitLoop;it worked, so don't keep trying more drive letters Next If NOT $closed Then;it failed, so let the user know and exit MsgBox(0, "Failed", "Sorry, could not find a CD drive that would let me open it") Exit EndIf ;;; Case $msg = $button_3 Run ('"C:\Program files\Internet Explorer\IEXPLORE.EXE" http://www.autoitscript.com/forum/index.php') ;;; Case $msg = $button_4 MsgBox(4096, "About", "A remote cdrom opener and closer for those that have a hard time reaching their cdrom From http://www.autoitscript.com/forum/index.php", 10) ;;; EndSelect WEnd Exit Thanks pekster for the help . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now