Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
[La característica asociada a esta página, MCI, es una característica heredada. Se ha reemplazado por MediaPlayer. MediaPlayer se ha optimizado para Windows 10 y Windows 11. Microsoft recomienda encarecidamente que el nuevo código use MediaPlayer en lugar de MCI, siempre que sea posible. Microsoft sugiere que el código existente que usa las API heredadas se reescriba para usar las nuevas API si es posible.
En el ejemplo siguiente se buscan las dimensiones necesarias para reproducir un archivo AVI, se crea una ventana correspondiente a ese tamaño y se reproduce el archivo en la ventana mediante el controlador MCIAVI. Usa la función mciSendCommand
HWND hwnd;
MCI_DGV_RECT_PARMS mciRect;
// Get the movie dimensions with MCI_WHERE.
mciSendCommand(wDeviceID, MCI_WHERE, MCI_DGV_WHERE_SOURCE,
(DWORD)(LPSTR)&mciRect);
// Create the playback window. Make it bigger for the border.
// Note that the right and bottom members of RECT structures in MCI
// are unusual; rc.right is set to the rectangle's width, and
// rc.bottom is set to the rectangle's height.
hwndMovie = CreateWindow("mywindow", "Playback",
WS_CHILD|WS_BORDER, 0,0,
mciRect.rc.right+(2*GetSystemMetric(SM_CXBORDER)),
mciRect.rc.bottom+(2*GetSystemMetric(SM_CYBORDER)),
hwndParent, hInstApp, NULL);
if (hwndMovie){
// Window created OK; make it the playback window.
MCI_DGV_WINDOW_PARMS mciWindow;
mciWindow.hWnd = hwndMovie;
mciSendCommand(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
(DWORD)(LPSTR)&mciWindow);
}