This function provides a simple way of playing a multimedia data file. It supports any multimedia file type or RIFF compound files.
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 file synchronously unless the MCI_ASYNC or MCI_ASYNCRENDEZVOUS flag is specified. The message queue is processed during its processing.
When the file name that is passed is a NULL pointer or an empty buffer, then an MCIERR_MISSING_PARAMETER error is returned unless the MCI_STOPACTIVE or MCI_RENDEZVOUS flags are set. In order to stop a currently active command, use the MCI_STOPACTIVE flag.
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.
When the pszFile parameter is specified and there is an active PLAY command associated with the specified owner window, the first command is superceded by the second command.