mciDriverNotify

BOOL WINAPI mciDriverNotify(HANDLE hCallback, UINT uDeviceID, 
    UINT uStatus)
 

This function is used by a driver to post a notification message. MCI devices use this function only when the MCI_NOTIFY flag is used with an MCI command message.

hCallback
Specifies the handle of the window to notify.
uDeviceID
Specifies the device ID which triggered the callback.
uStatus
Specifies the status of the callback. Status values include:
MCI_NOTIFY_ABORTED Specifies that the device received a command that prevented the current conditions for initiating the callback from being met. If a new command interrupts the current command and it also requests notification, send this message and not MCI_NOTIFY_SUPERSEDED.
MCI_NOTIFY_SUCCESSFUL Specifies that the conditions initiating the callback have been met.
MCI_NOTIFY_SUPERSEDED Specifies that the device received another command with the MCI_NOTIFY flag set and the current conditions for initiating the callback have been superseded.
MCI_NOTIFY_FAILURE Specifies that a device error occurred while the device was executing the command.

This function is callable at interrupt time.

A device sends MCI_NOTIFY_SUCCESSFUL when the action for a command finishes. For example, a CD audio device uses this flag for notification for MCI_PLAY when the device finishes playing. The MCI_PLAY command completes successfully only when it reaches the specified end position or reaches the end of the media. Similarly, MCI_SEEK and MCI_RECORD do not return MCI_NOTIFY_SUCCESSFUL until they reach the specified end position or reach the end of the media.

A device sends MCI_NOTIFY_ABORTED only when it receives a command that prevents it from meeting the notification conditions. For example, the command MCI_PLAY would not abort notification for a previous play command provided that the new command does not change the play direction or change the ending position for the play command with an active notify. The MCI_RECORD and MCI_SEEK commands behave similarly.

Do not send MCI_NOTIFY_ABORTED when MCI_PLAY or MCI_RECORD is paused with MCI_PAUSE. The MCI_RESUME command delays completion of MCI_PLAY and MCI_RECORD but does not cancel the commands. The MCI_RESUME command will let them continue to meet the callback conditions.

If a device cannot execute a command, set the error return for the message but do not send a notification message.