Skip to content

Instantly share code, notes, and snippets.

@KingCprey
Created November 20, 2016 21:35
Show Gist options
  • Save KingCprey/1b7290359e0a246c402cbf29175f9efc to your computer and use it in GitHub Desktop.
Save KingCprey/1b7290359e0a246c402cbf29175f9efc to your computer and use it in GitHub Desktop.
VB.NET code to open and close cd tray
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal Command As String, ByVal ReturnString As String, ByVal ReturnLength As Long, ByVal hWnd As Long) As Long
'Open CD Drive
'mciSendString("set cdaudio door open",0,0,0)
'Close CD Drive
'mciSendString("set cdaudio door closed",0,0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment