MCI_REDO
This message redoes the cut, paste, or delete operation most recently undone by MCI_UNDO. MCI_REDO should immediately follow MCI_UNDO; otherwise, editing actions performed after MCI_UNDO (and before a corresponding MCI_REDO) will be lost when MCI_REDO is issued. The media position is at the beginning of the file after a redo operation.
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:
- MCI_NOTIFY Posts a notification message when the action completes.
- MCI_WAIT Does not return control until the action is completed.
- pParam2 (PMCI_GENERIC_PARMS) - input
- A pointer to the MCI_GENERIC_PARMS structure.
Returns
- rc (ULONG) - returns
-
- MCIERR_SUCCESS Redo was successful.
- MCIERR_INVALID_DEVICE_ID The device ID is not valid.
- MCIERR_INSTANCE_INACTIVE The device is currently inactive. Issue MCI_ACQUIREDEVICE to make the device context active.
- MCIERR_CANNOT_REDO Redo is not possible in the current state (no undo actions to redo).
- MCIERR_INVALID_CALLBACK_HANDLE Given callback handle is invalid.
Remarks
MCI_REDO operates on one editing action at a time. If there are no more possible actions to be redone (i.e., the file is already in the state where the latest change was made), then `MCIERR_CANNOT_REDO` is returned.
> [!NOTE] > The redo operation is unlimited corresponding to the number of undo operations that have been performed. However, after a **save**, any previous editing actions are cleared and cannot be redone.
Not all devices support this message. To determine if a device supports MCI_REDO, issue MCI_GETDEVCAPS. If the redo operation interrupts an in-progress operation, such as play, the command is aborted and an MM_MCINOTIFY message will be sent to the application.
Example Code
USHORT usDeviceID;
MCI_EDIT_PARMS mep;
mep.hwndCallback = hwndMyWindow;
mciSendCommand(usDeviceID,
MCI_REDO,
MCI_NOTIFY,
&mep,
0 );