C++??????mciSendString????????
???????????? ???????[ 2012/12/6 10:33:58 ] ????????
????mciSendString???????????y???????API??????????MPEG??AVI??WAV??MP3?????????????????????????????÷?????
???????????y???????
??????????Dialog????????Picture?????MCISendString?????Picture??????????????y???????
??????Picture?????ID?IDC_STATIC1??
??CStatic *pStatic=(CStatic*)GetDlgItem(IDC_STATIC1);HWNDh=pStatic->GetSafeHwnd();
????CString open1;
????char buf[256];
????open1.Format("open f:""mpeg""mpeg1.avi type MPEGVideo Aliasmovie parent %u Style %u notify"?? h??WS_CHILD);
????mciSendString(open1.GetBuffer(open1.GetLength())??buf??sizeof(buf)??NULL);
????????F???????mpeg???μ?mpeg1.avi????????е?typeMPEGVideo?????MPEG??AVI??????????????type MPEGVideo????????WAV??MP3???Aliasmovie??????mpeg1.avi??????movie???????????????movie???????mpeg1.avi??
?????????????y???????
???????????????????f:"mpeg"mpeg1.avi????????????????????
????mciSendString("play movie"??buf??sizeof(buf)??NULL);
?????????????????
????mciSendString("play moviefullscreen"??buf??sizeof(buf)??NULL);
????????????????
????mciSendString("pause movie"??buf??sizeof(buf)??NULL);
??????????????
????mciSendString("close movie"??buf??sizeof(buf)??NULL);
?????塢??????????????????
????char sPosition[256];long lLength;
????mciSendString("Status movie length"?? sPosition??255??0);lLength=strtol(sPosition?? NULL?? 10);
????????lLength?????????????????
???????????????????????????С??
????char chVolume[256];long lVolume;mciSendString("status movievolume"??chVolume??255??0);lVolume=strtol(chVolume??NULL??10);????lVolume??????????????????С??
????????????????λ?ò????
??CString step1;long lPosition;
????lPosition=100;
????step1.Format("seek movie to %ld"??lPosition);
????mciSendString(step1.GetBuffer(step1.GetLength())??buf??sizeof(buf)??0);
????????lPosition??????????λ????????????????
????////////////////////////////////////////////////////////////////////////////////
???????濴???????mp3???????????
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib?? "WINMM.LIB")
int main(int argc?? char *argv[])
{
mciSendString(TEXT("open ??????.mp3 alias mysong")?? NULL?? 0??NULL);
mciSendString(TEXT("play MySong")?? NULL?? 0?? NULL);
Sleep(5 * 60 * 1000);
return 0;
}
????////////////////////////////////////////////////////////////////////////////////
?????ú????????????avi??????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11