http://go4.163.com/qiujier/content/media.htm
<截选>
清单1的代码演示了用MCI命令消息来打开和重复播放一个AVI文件:
清单1
MCI_DGV_OPEN_PARMS mciOpen;
UINT wDeviceID;
MCIERROR mciError;
mciOpen.lpstrDeviceType = "avivideo";
//设备名
mciOpen.lpstrElementName = "dillo.avi";
//设备元素
mciError=mciSendCommand(0, MCI_OPEN,
MCI_OPEN_TYPE|MCI_OPEN_ELEMENT, //使用了设备元素
(DWORD)&mciOpen);
if(mciError)
{
char s[80];
mciGetErrorString(mciError,s,80);
AfxMessageBox(s);
return
}
wDeviceID=mciOpen.wDeviceID;
//保存设备ID
MCI_DGV_PLAY_PARMS mciPlay;
mciError=mciSendCommand(wDeviceID, MCI_PLAY, MCI_DGV_PLAY_REPEAT,
(DWORD)&mciPlay);
. . .