// Build the graph.
pGraph->RenderFile(L"Test.avi", NULL);
//Set the video window.
//Attach the video playback window to the desired parent window.
//call the IVideoWindow::put_Owner method and pass it a handle to the owner window.
pVidWin->put_Owner((OAHWND)g_hwnd);
pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
RECT grc;
GetClientRect(g_hwnd, &grc);
pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom);
// Run the graph.
pMediaControl->Run();
}
void CleanUp(void)
{
//Before the application exits, it is important that
//you set the visibility of the video window to false.
// Otherwise, a video image remains on the screen
//and the user cannot get rid of it. Then, reset the owner to NULL;
//otherwise, messages are sent to the wrong window, likely causing errors.