MCI_CLOSE

This MCI command message is sent by an application to release access to a device or device element. All devices respond to this message.

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 close operation should finish before MCI returns control to the application.

LPMCI_GENERIC_PARMS lParam2

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

Return Value

Returns zero if successful. Otherwise, it returns an MCI error code.

Comments

MCI_CLOSE applies to each instance of a digital-video device driver. Closing an instance releases all resources associated with it. If the window is a default window, it is destroyed; otherwise the contents of the window are not defined. If the workspace contains unsaved data, or there is a save in progress, then the associated data is lost. Your applications might choose to protect the user from losing this data. You can use the MCI_DGV_STATUS_UNSAVED and MCI_STATUS_FILE_MODE flags for the MCI_STATUS message to determine if the user might lose any unsaved data.

Your application should explicitly close each device or device element when it finishes using the device. MCI unloads a device when all instances of it are closed.

See Also

MCI_OPEN, MCI_STATUS