MCI CLOSE: Difference between revisions
Appearance
Created page with "{{DISPLAYTITLE:MCI_CLOSE}} This message requests that the current media device instance be closed and all resources associated with it be released. ==Syntax== <PRE> param1 ULONG ulParam1; →Flags for close operation.: param2 PMCI_GENERIC_PARMS pParam2; →Pointer to a default MCI parameter structure.: </PRE> ==Parameters== ;''ulParam1'' (ULONG) - input :This parameter can contain any of the following flags: :* '''MCI_NOTIFY''' A notification message will be p..." |
(No difference)
|
Latest revision as of 02:39, 26 November 2025
This message requests that the current media device instance be closed and all resources associated with it be released.
Syntax
param1 ULONG ulParam1; /* Flags for close operation. */ param2 PMCI_GENERIC_PARMS pParam2; /* Pointer to a default MCI parameter structure. */
Parameters
- ulParam1 (ULONG) - input
- This parameter can contain any of the following flags:
- MCI_NOTIFY A notification message will be posted to the window specified in the hwndCallback parameter of the data structure pointed to by the pParam2 parameter. The notification will be posted when the action indicated by this message is completed or when an error occurs.
- MCI_WAIT Control is not to be returned until the action indicated by this message is completed or an error occurs.
- MCI_CLOSE_EXIT This flag is recognized and accepted by media control drivers (MCDs); however, it should only be sent by the Media Device Manager (MDM). This flag informs the MCD that this particular close operation is coming from an exit list routine. When an MCD receives this, it will terminate in the usual way. All other threads have been terminated. When this flag is received, the MCD must assume that the current thread is the only thread in its process.
- pParam2 (PMCI_GENERIC_PARMS) - input
- A pointer to a default media control interface parameter data structure.
Returns
- rc (ULONG) - returns
- Return codes indicating success or type of failure:
- MCIERR_SUCCESS MMPM/2 command completed successfully.
- MCIERR_OUT_OF_MEMORY System out of memory.
- MCIERR_INVALID_DEVICE_ID Invalid device ID given.
- MCIERR_MISSING_PARAMETER Missing parameter for this command.
- MCIERR_DRIVER Internal MMPM driver error.
- MCIERR_INVALID_FLAG Invalid flag specified for this command.
Remarks
This section has no remarks.
Example Code
USHORT usDeviceID; /* Device ID */
MCI_GENERIC_PARMS mciGenericParms; /* Generic message
parms structure */
/* Close a device context */
mciSendCommand( usDeviceID, /* Device ID to close */
MCI_CLOSE, /* MCI close message */
MCI_WAIT, /* Flag for this message */
(PVOID) &mciGenericParms,/* Data structure */
0); /* No user parameter */