This is a simple CD tray
HTML Code:
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("CD", 118, 61, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE)) $Button1 = GUICtrlCreateButton("Open", 0, 0, 117, 60) GUISetState(@SW_SHOW) $E = DriveGetDrive("CDROM") $OC = 0 While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $OC = 1 Then CDTray($E[1] & "\", "Close") GUICtrlSetData ($Button1,"Open") $OC = 0 Elseif $OC = 0 Then CDTray($E[1] & "\", "open") GUICtrlSetData ($Button1,"Close") $OC = 1 EndIf EndSwitch WEnd






