Handling the MCI_NOTIFY Flag

All MCI command tables must include the MCI_NOTIFY flag for all commands. Applications use this flag to request notification when an operation has completed.

Normally when an MCI driver receives a command, it should initiate the associated operation and then return control to the calling application. For example, if an application sends an MCI_SEEK command, the driver should start the seek operation and immediately return. The application is not notified when the operation completes.

As an option, an application sending any MCI command can request to be notified when the command operation has completed. To do this, the application specifies the following arguments along with the command:

·The MCI_NOTIFY flag. The driver receives this flag in the lParam1 argument to DriverProc.

·A window handle. The driver receives this handle as the dwCallback member of any structure whose address is passed as the lParam2 argument to DriverProc.

When a driver receives an MCI command that includes the MCI_NOTIFY flag, the driver must start the specified operation and then return. When the operation completes, the driver must call mciDriverNotify in winmm.dll. The mciDriverNotify function enqueues an MM_MCINOTIFY message to the window specified in dwCallback. The application's window procedure must check for and process the MM_MCINOTIFY message.