class CAnimationDlg : public CDialog
{
// Construction
public:
CAnimationDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAnimationDlg)
enum { IDD = IDD_ANIMATION_DIALOG };
CAnimateCtrl m_ctrlAnimation;
//}}AFX_DATA
..
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CAnimationDlg)
virtual BOOL OnInitDialog();
..
afx_msg void OnPlay();
afx_msg void OnStop();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CAnimationDlg, CDialog)
//{{AFX_MSG_MAP(CAnimationDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(ID_PLAY, OnPlay)
ON_BN_CLICKED(ID_STOP, OnStop)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
..
BOOL CAnimationDlg::OnInitDialog()
{
..
SetIcon(m_hIcon, FALSE); // Set small icon
m_ctrlAnimation.Open(IDR_AVI1);
return TRUE; // return TRUE unless you set the focus to a control
}
..
void CAnimationDlg::OnPlay()
{
m_ctrlAnimation.Play(0, -1, 1);
}
void CAnimationDlg::OnStop()
{
m_ctrlAnimation.Stop();
}