mmpSetFrameHook

Syntax

BOOL mmpSetFrameHook(idMovie, lpFrameHook)

This function hooks a callback function into the movie playback. The callback function is called after each frame update and before script-channel commands are processed.

Parameters

MMPID idMovie

Identifies the movie ID of the Movie Player instance.

LPMMPFRAMEHOOK lpFrameHook

Specifies the procedure-instance address of the callback function. To remove your callback function, pass the original callback-function address (obtained using mmpGetFrameHook) to this parameter.

Return Value

Returns TRUE if successful, otherwise returns FALSE.

Comments

The attached function is called after screen updates for each frame and subframe are concluded.

Callback

BOOL FAR PASCAL FrameHook(idMovie, wMsg, wParam, lParam)

FrameHook is a placeholder for the application-supplied function name. Export the actual name by including it in the EXPORTS statement in your module-definition file.

Parameters

MMPID idMovie

Identifies the movie ID of the Movie Player instance.

WORD wMsg

Specifies a message indicating the reason for calling the frame-hook function. This message is either MMP_HOOK_FRAME or MMP_HOOK_SCRIPT.

WORD wParam

Specifies the frame index.

LONG lParam

Specifies a parameter for the message.

Return Value

The return value depends on the message specified by wMsg.

Comments

Any Movie Player functions called from the callback function must be directed to the current Movie Player instance. Do not close the movie file or the Movie Player instance from the frame-hook function; you can use PostMessage to notify a window function to close a movie file or Movie Player instance.

You should call any existing callback function at the end of your callback function. In this way, you can chain the frame-hook functions. Before hooking your callback function, use mmpGetFrameHook to obtain the address of the current callback function. If this value is not NULL, call the existing function at the end of your callback function.

To unhook your callback function, call mmpSetFrameHook and pass the original callback-function value (which may be NULL if no function was attached) to the lpFrameHook parameter.

See Also

mmpGetFrameHook, MMP_HOOK_FRAME, MMP_HOOK_SCRIPT