Specifying the Callback Function

Your callback function must have the following syntax:

BOOL FAR PASCAL FrameHook(
    MMPID idMovie,                                // Instance identifier
    WORD  wMsg,                                        // Message
    WORD  wParam,                                // Frame index
    LONG  lParam)                                // Message-dependent 

FrameHook is a placeholder for an application-supplied function name. Like all callback functions, the function name must be listed in the EXPORTS section of the module definition (.DEF) file for your application.

Any Movie Player functions called from the callback function must be directed to the current Movie Player instance. For example, the movie ID used in the callback function should be the same one used in the call to mmpSetFrameHook. If the callback function calls a Movie Player function with a different movie ID, the Movie Player function will fail, returning an MMPERR_BAD_ID error code.

Don't close the current movie file while processing a frame hook message. If you need to implement a close command in your application, you can post a message to the main window and close the movie file (or Movie Player instance) from there.