This function provides a simple way of playing a multimedia resource stored in a program resource.

The audio is played on the default media control interface device. A device control panel is not displayed for audio.

Still images are not supported.

For video, the default media control interface driver window is displayed. The movie is played from beginning to end. The window is destroyed when the device is closed. If an hwndViewport window is specified, then the video will be shown in the viewport window.

The default is to play the resource synchronously unless the MCI_ASYNC or MCI_ASYNCRENDEZVOUS flag is specified. The message queue is processed during its processing.

Either mciPlayFile or mciPlayResource could return an MCIERR_NO_ASYNC_PLAY_ACTIVE error. This error indicates that no asynchronous play is currently active for the associated owner window.

The title parameter can be NULL. If a title is specified and a window is displayed, the title is used as the window title. A window is only displayed if a video file is played.

If the resID is 0, MCIERR_MISSING_PARAMETER is returned unless the MCI_STOPACTIVE or MCI_RENDEZVOUS flags are set. To stop a currently active command, use the MCI_STOPACTIVE flag.


[Back] [Next]