????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??????