MCI_SPIN
Appearance
This message is used to start or stop the rotation of a disc-based media player (such as a videodisc or CD-ROM).
Syntax
param1 ULONG ulParam1; /* Message flags. */ param2 PMCI_GENERIC_PARMS pParam2; /* Pointer to the MCI_GENERIC_PARMS structure. */
Parameters
- ulParam1 (ULONG) - input
- The following flags can be used. Note that MCI_SPIN_UP and MCI_SPIN_DOWN are mutually exclusive.
- MCI_NOTIFY Posts a notification message when the action completes.
- MCI_WAIT Does not return control until the action is completed.
- MCI_SPIN_UP Starts the disc spinning.
- MCI_SPIN_DOWN Stops the disc from spinning.
- pParam2 (PMCI_GENERIC_PARMS) - input
- A pointer to the MCI_GENERIC_PARMS data structure.
Returns
- rc (ULONG) - returns
-
- MCIERR_SUCCESS If the function succeeds.
- MCIERR_INVALID_DEVICE_ID The device ID is not valid.
- MCIERR_INSTANCE_INACTIVE The device is currently inactive. Issue MCI_ACQUIREDEVICE to make it active.
- MCIERR_MISSING_FLAG A required flag is missing.
- MCIERR_UNSUPPORTED_FLAG Given flag is unsupported for this device.
- MCIERR_INVALID_CALLBACK_HANDLE Given callback handle is invalid.
- MCIERR_HARDWARE Device hardware error.
- MCIERR_UNSUPPORTED_FUNCTION Unsupported function.
- MCIERR_FLAGS_NOT_COMPATIBLE Mutually exclusive flags were used together.
Remarks
- **Default Processing:** If neither spin flag is specified, `MCI_SPIN_UP` is assumed by default.
- **Usage:** This is typically used with videodisc players to prepare the media before a `MCI_PLAY` command or to stop the motor to reduce wear/noise when the device is not in use.
Example Code
The following code illustrates how to start a videodisc spinning and request notification upon completion.
USHORT usDeviceID;
HWND hwndMyWindow;
MCI_GENERIC_PARMS mciGenericParms; /* Generic message parms structure */
/* Assign hwndCallback the handle to the window receiving notification */
mciGenericParms.hwndCallback = hwndMyWindow;
mciSendCommand( usDeviceID, /* Device ID */
MCI_SPIN, /* MCI spin message */
MCI_NOTIFY | MCI_SPIN_UP, /* Flags for this message */
(PVOID) &mciGenericParms, /* Data structure */
0 ); /* No user parm */