Classifications of MCI Commands

MCI defines four command classifications: system, required, basic, and extended. The following list describes these command classifications:

  • System commands are handled by MCI directly, rather than by the driver.
  • Required commands are handled by the driver. All MCI drivers must support the required commands and flags.
  • Basic commands (or optional commands) are used by some devices. If a device supports a basic command, it must support a defined set of flags for that command.
  • Extended commands are specific to a device type or driver. Extended commands include commands, like the put (MCI_PUT) and where (MCI_WHERE) commands for the digitalvideo and overlay device types, and extensions to existing commands (like the "stretch" flag of the status (MCI_STATUS) command for the overlay device type).

While system and required commands are the minimum command set for any MCI driver, basic and extended commands are not supported by all drivers. Your application can always use system and required commands and their flags, but if it needs to use a basic or extended command or flag, it should first query the driver by using the capability (MCI_GETDEVCAPS) command. The following sections summarize the specific commands in each category.

System Commands

MCI processes the following system commands directly, rather than passing them to MCI devices.

String Message Description
break MCI_BREAK Sets a break key for an MCI device.
sysinfo MCI_SYSINFO Returns information about MCI devices.

Required Commands

All MCI devices support the following required commands.

String Message Description
capability MCI_GETDEVCAPS Obtains the capabilities of a device.
close MCI_CLOSE Closes the device.
info MCI_INFO Obtains textual information from a device.
open MCI_OPEN Initializes the device.
status MCI_STATUS Obtains status information from the device. Some of this command's flags are not required, so it is also a basic command.

Devices must also support a standard set of command flags for the required commands.

Basic Commands

The following list summarizes the basic commands. The use of these commands by an MCI device is optional.

String Message Description
load MCI_LOAD Loads data from a file.
pause MCI_PAUSE Stops playing. Playback or recording can be resumed at the current position.
play MCI_PLAY Starts transmitting output data.
record MCI_RECORD Starts recording input data.
resume MCI_RESUME Resumes playing or recording on a paused device.
save MCI_SAVE Saves data to a disk file.
seek MCI_SEEK Seeks forward or backward.
set MCI_SET Sets the operating state of the device.
status MCI_STATUS Obtains status information about the device. This is also a required command; since some of its flags are not required, it is also listed here. (The optional items support devices that use linear media with identifiable positions.)
stop MCI_STOP Stops playing.

If a driver supports a basic command, it must also support a standard set of flags for the command.

Extended Commands

Some MCI devices have additional commands, or they add flags to existing commands. While some extended commands apply only to a specific device driver, most of them apply to all drivers of a particular device type. For example, the command set for the sequencer device type extends the set (MCI_SET) command to add time formats that are needed by MIDI sequencers.

You should not assume that the device supports the extended commands or flags. You can use the capability (MCI_GETDEVCAPS) command to determine whether a specific feature is supported, and your application should be ready to deal with "unsupported command" or "unsupported function" return values.

The following extended commands are available with the listed device types.

String Message Device types Description
configure MCI_CONFIGURE digitalvideo Displays a configuration dialog box.
cue MCI_CUE digitalvideo, waveaudio Prepares for playing or recording.
delete MCI_DELETE waveaudio Deletes a data segment from the media file.
escape MCI_ESCAPE videodisc Sends custom information to a device.
freeze MCI_FREEZE overlay Disables video acquisition to the frame buffer.
put MCI_PUT digitalvideo, overlay Defines the source, destination, and frame windows.
realize MCI_REALIZE digitalvideo Tells the device to select and realize its palette into a device context of the displayed window.
setaudio MCI_SETAUDIO digitalvideo Sets audio parameters for video.
setvideo MCI_SETVIDEO digitalvideo Sets video parameters.
signal MCI_SIGNAL digitalvideo Identifies a specified position with a signal.
spin MCI_SPIN videodisc Starts the disc spinning or stops the disc from spinning.
step MCI_STEP digitalvideo, videodisc Steps the play one or more frames forward or reverse.
unfreeze MCI_UNFREEZE overlay Enables the frame buffer to acquire video data.
update MCI_UPDATE digitalvideo Repaints the current frame into the device context.
where MCI_WHERE digitalvideo, overlay Obtains the rectangle specifying the source, destination, or frame area.
window MCI_WINDOW digitalvideo, overlay Controls the display window.