Hi, I was wondering if anyone knew any code snippets that do something cool like:
Open the CD tray:
mciSendString("open CDAudio", NULL, 0, NULL);
cout << "Opening CD-ROM door ..." << endl;
mciSendString("set CDAudio door open", NULL, 0, NULL);
cout << "Closing the CD-ROM door in 5 seconds ..." << endl;
Sleep(5000);
mciSendString("set CDAudio door closed", NULL, 0, NULL);
mciSendString("close CDAudio", NULL, 0, NULL);
Turn the monitor off and on:
cout << "Turning off monitor...";
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
cout << endl << "Turning monitor back on...";
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);