Ward Posted March 5, 2006 Share Posted March 5, 2006 (edited) CDDoor.au3: ;=============================================================================== ; Description: Open, Close, and Toggle CD Door ; Usage _OpenCDDoor(DriveName) ; _CloseCDDoor(DriveName) ; _ToggleCDDoor(DriveName) ; Author(s): Ward ;=============================================================================== Func _MCISendString($Str) DllCall("winmm.dll", "int", "mciSendString", "str", $str, "int", 0, "int", 0, "int", 0) EndFunc Func _OpenCDDoor($Drive) _MCISendString("Open " & $Drive & " Alias Drive" & $Drive & " Type CDAudio") _MCISendString("Set Drive" & $Drive & " Door Open") EndFunc Func _CloseCDDoor($Drive) _MCISendString("Open " & $Drive & " Alias Drive" & $Drive & " Type CDAudio") _MCISendString("Set Drive" & $Drive & " Door Closed") EndFunc Func _ToggleCDDoor($Drive) _MCISendString("Open " & $Drive & " Alias Drive" & $Drive & " Type CDAudio") $Timer = TimerInit() _MCISendString("Set Drive" & $Drive & " Door Open") If TimerDiff($Timer) < 200 Then _MCISendString("Set Drive" & $Drive & " Door Closed") EndIf EndFunc An example (use Ctrl+Numpad0 to toggle door of first cdrom, Ctrl+Numpad1 for 2nd cdrom, ect.) #include "CDDoor.au3" Global $CDROMList = DriveGetDrive("CDROM") For $i = 1 To $CDROMList[0] HotKeySet("^{NUMPAD" & ($i - 1) & "}", "OnToogleDoor") Next Func OnToogleDoor() _ToggleCDDoor($CDROMList[StringMid(@HotKeyPressed, 9, 1) + 1]) EndFunc While True Sleep(200) Wend Edited March 5, 2006 by Ward 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
GrungeRocker Posted March 5, 2006 Share Posted March 5, 2006 (edited) hey, i like it!was searching for it 3 days ago! Edited March 5, 2006 by Analritter [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
RazerM Posted March 5, 2006 Share Posted March 5, 2006 this is quite useful, I like it. far easier than reaching down for the cd drive My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2006 Developers Share Posted March 5, 2006 CDtray() ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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