재생 상태 변경
[이 페이지 MCI와 연결된 기능은 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 MCI 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]
다음 예제에서는 mciSendString 함수에서 일시 중지, 다시 시작, 중지 및 검색 명령을 사용하는 방법을 보여 줍니다.
// Assume the file was opened with the alias 'movie'.
// Pause play.
mciSendString("pause movie", NULL, 0, NULL);
// Resume play.
mciSendString("resume movie", NULL, 0, NULL);
// Stop play.
mciSendString("stop movie", NULL, 0, NULL);
// Seek to the beginning.
mciSendString("seek movie to start", NULL, 0, NULL);
다음 예제에서는 검색 모드를 변경하는 방법을 보여줍니다.
// Set seek mode with the string interface.
// Assume the file was opened with the alias 'movie'.
void SetSeekMode(BOOL fExact)
{
if (fExact)
mciSendString("set movie seek exactly on", NULL, 0, NULL);
else
mciSendString("set movie seek exactly off", NULL, 0, NULL);
}