|
General Details
|
|
C++
|
|
Posted 121 Days Ago
|
|
182 Views
|
|
Received 1 Rating
|
|
Open/Close CD Tray
Description
Basicly just opens up your CD tray...
Technical
Microsoft Visual C++ 6.0
Source Code
Comments
| Please login to post comments. |
|
|
Lakario, make sure you are using Visual C++ 6.0, if not you will have to link them. For Dev it would be -lwinmm.
You can put this into one file instead, without making a functions file.
//////////////////////////////// main.cpp ///////////////////////////
// If you are using such as dev-cpp. You will have to link the following -> -lwinmm.
#pragma comment(lib, "winmm.lib") // Comment this out if NOT using Microsoft Visual C++
#include <windows.h>
void OpenCDTray()
{
mciSendString("set cdaudio door open", NULL, 0, NULL);
}
void CloseCDTray()
{
mciSendString("set cdaudio door close", NULL, 0, NULL);
}
int main()
{
OpenCDTray();
CloseCDTray();
}
|
|
|
what is that functions.h? I have no such library.
|
|
|
Nice, i was always wondering how to do that! Maybe I can loop it continuously and place it on my brother's PC (as you can tell from my other posts around here I'm not too keen on my brother :P).
You also forgot to close your function void CloseCDTray(). You should have a closing curly brace on line 24.
Best regards,
-Mike
|
More "C++" Source Codes By This Author
Recently Posted "C++" Source Codes
Recently Rated "C++" Source Codes
|