The following function uses the predefined macros to control the display of the AVI clip in an animation control.
// DoAnimation - plays, stops, or closes an animation control's
// AVI clip, depending on the value of an action flag.
// hwndAnim - handle to an animation control
// nAction - flag that determines whether to play, stop, or close
// the AVI clip
void DoAnimation(HWND hwndAnim, int nAction)
{
switch (nAction) {
case PLAYIT:
// Play the clip continuously starting with the
// first frame.
Animate_Play(hwndAnim, 0, -1, -1);
break;
case STOPIT:
Animate_Stop(hwndAnim);
break;
case CLOSEIT:
Animate_Close(hwndAnim);
break;
default:
break;
}
return;
}