This class is a simple owner-draw CButton
class that allows you to play animation files (AVI's) within the button. This class can be used like any other owner drawn control - simply include the header file, and declare your button controls as CAniButton
instead of CButton
The class has the following methods:
BOOL Open( LPCTSTR lpszFileName );
BOOL Open( UINT nID );
void Play();
void Stop();
void Close();
To setup the button to play an animation, first add an AVI to your resources by editing the .rc file by hand and adding the following:
IDR_AVI1 AVI DISCARDABLE "res\\Animation.avi"
where Animation.avi is an AVI file in your /res directory (remember to define IDR_AVI1 in your resource.h file). Then, after creating the control (or in your dialogs OnInitDialog
function, add the following
m_Button.Open(IDR_AVI1);
m_Button.Play();
where m_Button is your animation button.