Routing Messages

The MCI Movie Driver handles all updates to its default stage window. However, your application must route Windows messages to the stage window. Your application owns all windows created by the driver.

It is recommended that you specify a NULL window handle in the message-loop GetMessage or PeekMessage function; this collects messages for all windows owned by the application. For example, the following message loop ensures that Windows messages are properly routed to the driver's default playback window.

while(GetMessage(&msg, NULL, 0, 0))  // Gets messages for all owned windows
{
        TranslateMessage(&msg);
        DispatchMessage(&msg);
}

If you are using the default stage window, and you want to specify a window handle in the GetMessage function, you can get the handle to the stage window using the MCI_STATUS command message.