检索有关电影的信息
以下示例将时间格式设置为帧,并在设备使用 mciSendCommand 函数播放时获取当前位置。
MCI_DGV_SET_PARMS mciSet;
MCI_DGV_STATUS_PARMS mciStatus;
// Put in frame mode.
mciSet.dwTimeFormat = MCI_FORMAT_FRAMES;
mciSendCommand(wDeviceID, MCI_SET,
MCI_SET_TIME_FORMAT,
(DWORD)(LPSTR)&mciSet);
mciStatus.dwItem = MCI_STATUS_MODE;
mciSendCommand(wDeviceID, MCI_STATUS,
MCI_STATUS_ITEM,
(DWORD)(LPSTR)&mciStatus);
// If device is playing, get the position.
if (mciStatus.dwReturn == MCI_MODE_PLAY)
{
mciStatus.dwItem = MCI_STATUS_POSITION;
mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)(LPSTR)&mciStatus);
// Update the position from mciStatus.dwReturn.
}