Showing the Stage Window

Use the MCI_WINDOW command message to change the display state of the stage window. The parameter block for the MCI_WINDOW message is as follows:

typedef struct {
    DWORD   dwCallback;             // Callback function to notify
    WORD    hWnd;                   // Supplied window handle
    WORD    wReserved1;
    WORD    nCmdShow;               // Display styles
    WORD    wReserved2;
    LPSTR   lpstrText;              // Pointer to window-caption text
} MCI_ANIM_WINDOW_PARMS;

The MCI_WINDOW message also allows you to set the stage-window caption and to provide a handle to a window that your application creates.

To change the display state of the stage window, set the nCmdShow field of the structure to any of the window-state flags used with the ShowWindow function. Pass the MCI_ANIM_WINDOW_STATE flag with the MCI_WINDOW command message. For example, the following code fragment hides the playback window:

MCI_ANIM_WINDOW_PARMS mciWindow;
DWORD dwError;

mciWindow.nCmdShow = SW_HIDE;

dwError = mciSendCommand(wDeviceID, MCI_WINDOW, MCI_ANIM_WINDOW_STATE,
                (DWORD)(LPVOID)&mciWindow);
if(dwError)
    showError(dwError);                 // Display MCI error string

Using window-manager functions, the application could do the following:

MCI_STATUS_PARMS mciStatus;

// Retrieve the handle to the stage window

mciStatus.dwItem = MCI_ANIM_STATUS_HWND;
dwError = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM,
                          (DWORD)(LPVOID)&mciStatus);

if(dwError)
    showError(dwError)                  // If error, display error string
else
{
    if(!IsHidden((HWND)mciStatus.dwReturn))
        ShowWindow((HWND)mciStatus.dwReturn, SW_HIDE);
}