#include <windows.h>
#include <mmsystem.h>
int WINAPI
WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
//连接没有库,在连接里添加“winmm”这个文件,就可以运行了
PlaySound (TEXT("E:\\下载\\3.wav"),NULL,SND_FILENAME|SND_ASYNC|SND_LOOP);
//SND_SYNC是在播放完音乐后再返回 SND_ASYNC是异步 歌曲格式只支持wav
//SND_LOOP是音乐循环播放
MessageBox (NULL, TEXT("1"), TEXT("2"),MB_OK);
//打开光驱
mciSendString ("set cdaudio door open","",0,0);
int rt = MessageBox (NULL, TEXT("关闭光驱\n换行了"), TEXT("close"),MB_OKCANCEL);
if(rt==IDOK)
{
//关闭光驱
mciSendString ("set cdaudio door closed","",0,0);
}
//关闭显示器
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
return 0;
}
文章评论(0条评论)
登录后参与讨论