Advertisement
6_2008-2009 Miscellaneous #211543

Open / Close CD Tray

This code just shows you how to open and close the cd tray, pretty straight forward

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
// Look into the mciSendString function, it can do a lot of interesting things, Have Fun
#include <windows.h>    
#include <mmsystem.h>
int main(int argc, char *argv[])
{
HWND hwnd = FindWindow(0, argv[0]); // Find our program window
ShowWindow(hwnd, SW_HIDE); // Hides it
for(;;)
{
mciSendString("Set CDAudio Door Open wait", 0, 0, 0); // Opens Cd Tray
mciSendString("Set CDAudio Door Closed wait", 0, 0, 0); // Closes CD tray
}
}

Upload
Original Comments (3)
Recovered from Wayback Machine