自动摇篮

//把摇篮栅在电脑读光盘地放,一个简单的自动摇篮

#include <mmsystem.h>
#pragma comment (lib, "winmm.lib")

void AutoBassinette()
{    

        while (1) 

         {

             //一、打开CD-ROM 

              mciSendString("Set cdAudio door open wait",NULL,0,NULL); 

              ::Sleep(1000);

              //二、关闭CD_ROM 

              mciSendString("Set cdAudio door closed wait",NULL,0,NULL); 

              ::Sleep(1000);

             }
}

你可能感兴趣的:(自动摇篮)