開啟播放視窗
下列範例示範如何使用 MCI_OPEN 命令來設定父視窗,並建立該視窗的子系。
MCI_DGV_OPEN_PARMS mciOpen;
mciOpen.lpstrElementName = lpstrFile; // Set the filename.
mciOpen.dwStyle = WS_CHILD; // Set the style.
mciOpen.hWndParent = hWnd; // Give a window handle.
if (mciSendCommand(0, MCI_OPEN,
(DWORD)(MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN),
(DWORD)(LPSTR)&mciOpen) == 0)
{
// Open operation is successful. Continue.
}