Application-Defined Window

An application-defined window can be used when the application requires more control over the window. The application can place video in its own client area or in a child window, add menus, and so on. If an application specifies a parent window handle when opening the device, it must close the logical video device before destroying the parent window.

If an application passes a window handle to the digital video device with MCI_WINDOW, it is essential that the application ensure that this window will receive all WM_REALIZEPALETTE messages sent to the message queue. If the window is a client-frame window (its parent has a style of CS_FRAME and the window has an ID of FID_CLIENT) or the child of a client window, it will receive this message automatically. If, however, the window has an ancestor that is not a client window and does not pass WM_REALIZEPALETTE to WinDefWindowProc, the window will not automatically receive the message. For example, WinDefDlgProc does not pass WM_REALIZEPALETTE on to child windows. So, if an ancestor of the window is a dialog window, the dialog procedure must explicitly pass the WM_REALIZEPALETTE message to the window. If the window does not receive this message, then incorrect colors will appear in video displayed in the window, whenever another application changes the system palette.

When an application-defined window is used to display video, the digital video device subclasses the window to ensure that video updating is maintained correctly. Subclassing the window does the following:


[Back: Default Window]
[Next: Opening the Device]