Partager via


CAnimateCtrl Class

Provides the functionality of the Windows common animation control.

class CAnimateCtrl : public CWnd

Members

Public Constructors

Name

Description

CAnimateCtrl::CAnimateCtrl

Constructs a CAnimateCtrl object.

Public Methods

Name

Description

CAnimateCtrl::Close

Closes the AVI clip.

CAnimateCtrl::Create

Creates an animation control and attaches it to a CAnimateCtrl object.

CAnimateCtrl::CreateEx

Creates an animation control with the specified Windows extended styles and attaches it to a CAnimateCtrl object.

CAnimateCtrl::IsPlaying

Indicates whether an Audio-Video Interleaved (AVI) clip is playing.

CAnimateCtrl::Open

Opens an AVI clip from a file or resource and displays the first frame.

CAnimateCtrl::Play

Plays the AVI clip without sound.

CAnimateCtrl::Seek

Displays a selected single frame of the AVI clip.

CAnimateCtrl::Stop

Stops playing the AVI clip.

Remarks

This control (and therefore the CAnimateCtrl class) is available only to programs running under Windows 95, Windows 98, and Windows NT version 3.51 and later.

An animation control is a rectangular window that displays a clip in AVI (Audio Video Interleaved) format— the standard Windows video/audio format. An AVI clip is a series of bitmap frames, like a movie.

Animation controls can play only simple AVI clips. Specifically, the clips to be played by an animation control must meet the following requirements:

  • There must be exactly one video stream and it must have at least one frame.

  • There can be at most two streams in the file (typically the other stream, if present, is an audio stream, although the animation control ignores audio information).

  • The clip must either be uncompressed or compressed with RLE8 compression.

  • No palette changes are allowed in the video stream.

You can add the AVI clip to your application as an AVI resource, or it can accompany your application as a separate AVI file.

Because your thread continues executing while the AVI clip is displayed, one common use for an animation control is to indicate system activity during a lengthy operation. For example, the Find dialog box of File Explorer displays a moving magnifying glass as the system searches for a file.

If you create a CAnimateCtrl object within a dialog box or from a dialog resource using the dialog editor, it will be automatically destroyed when the user closes the dialog box.

If you create a CAnimateCtrl object within a window, you may need to destroy it. If you create the CAnimateCtrl object on the stack, it is destroyed automatically. If you create the CAnimateCtrl object on the heap by using the new function, you must call delete on the object to destroy it. If you derive a new class from CAnimateCtrl and allocate any memory in that class, override the CAnimateCtrl destructor to dispose of the allocations.

For more information on using CAnimateCtrl, see Controls and Using CAnimateCtrl.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CAnimateCtrl

Requirements

Header: afxcmn.h

See Also

Reference

CWnd Class

Hierarchy Chart

CAnimateCtrl::Create

ON_CONTROL