#include <windows.h> #include <MMSystem.h> #pragma comment( lib, "winmm.lib" ) int main() { mciSendStringA( "set cdaudio door closed", NULL, 0, NULL ); return 0; }
用Python代码实现:
import ctypes
dll = ctypes.windll.LoadLibrary("winmm.dll")
dll.mciSendStringA("set cdaudio door closed", 0, 0, 0)