MCI_OPEN

This MCI command message is sent by an application to initialize an instance of the device or device element. Each open creates an independent instance of the device driver, which can be referenced by its device name. There might be device-specific restrictions on how many device instances can be opened simultaneously. The parameters and flags available for this message depend on the selected device.

Parameters

DWORD lParam1

The following flags apply to all devices:


MCI_NOTIFY

Specifies that MCI should post the MM_MCINOTIFY message when this command completes. The window that receives this message is specified in the dwCallback field of the data structure identified by lParam2.

MCI_WAIT

Specifies that the open operation should finish before MCI returns control to the application.

MCI_OPEN_ALIAS

Specifies that an alias is referenced in the lpstrAlias field of the data structure identified by lParam2. The alias is used to reference an instance of the device driver. The open is rejected if the alias specified is already in use by this application. If the flag is omitted, the default alias is the specified filename.

MCI_OPEN_SHAREABLE

Specifies that a single instance of the associated file can be accessed by two or more device instances. That is, file positioning commands directed towards one device driver instance will affect the position in the other device driver instances. Each device driver instance, however, might have an independent window as well as other characteristics not directly related to file positioning. If the device uses only a single instance of digitizer hardware, this flag also lets a single digitizer frame buffer be shared by multiple device driver instances.

MCI_OPEN_TYPE

Specifies that a device-type constant or a pointer to a device-type name is included in the lpstrDeviceType field of the data structure identified by lParam2.

MCI_OPEN_TYPE_ID

Specifies that the low-order word of the lpstrDeviceType field of the data structure identified by lParam2 contains a standard MCI device type ID and the high-order word optionally contains the ordinal index for the device. Use this flag with the MCI_OPEN_TYPE flag.

LPMCI_OPEN_PARMS lParam2

Specifies a far pointer to the MCI_OPEN_PARMS data structure. (Devices with extended command sets might replace this data structure with a device-specific data structure.)