The MCIWndCreate function registers and creates an MCIWnd window. The window can be a parent, child, or pop-up window. The following example creates an MCIWnd window as a child window and lets the user control playback by providing access to the trackbar and the Play, Stop, and Menu buttons. The example specifies a handle of a parent window and specifies NULL for the window styles, so the default window styles of WS_CHILD, WS_BORDER, and WS_VISIBLE are used to create the MCIWnd window.
// Global variable and constants
// extern HINSTANCE g_hinst; instance handle
// extern HWND g_hwndMCIWnd; MCIWnd window handle
case WM_COMMAND:
switch (wParam) {
case IDM_CREATEMCIWND:
g_hwndMCIWnd = MCIWndCreate(hwnd, g_hinst, NULL,
"sample.avi");
break;
}
break;
Note You could also specify NULL for both the parent window handle and the window styles, in which case the default window styles would be WS_OVERLAPPED and WS_VISIBLE.