Home
Recent changes

ATL code
WTL code
MFC code
C++ code
.Net code
PocketPC code
Miscellaneous

viksoe.dk

Waiting Animation control

Waiting Animation control

This simple control is a subclassed STATIC Windows control, which displays an animation similar to the Windows Vista spinning wheel cursor animation.

To use it, place a static control (label) on your dialog.
Add a member variable to your dialog implementation file...

CWaitingAnimCtrl m_ctlWaiting
In the OnInitDialog() event handler, add the following line:
  LRESULT OnInitDialog(UINT /*uMsg*/, 
                       WPARAM /*wParam*/, 
                       LPARAM /*lParam*/, 
                       BOOL& /*bHandled*/)
  {
    ...
    m_ctlWaiting.SubclassWindow(GetDlgItem(IDC_ANIM));
    m_ctlWaiting.Start();
    ...
  }

Start the animation with the Start method.
Set the animation speed with the SetAnimDelay method.

Source Code Dependencies

Microsoft Visual C++ 6.0
Microsoft WTL 7.0 Library

Download Files

DownloadSource Code (22 Kb)


Written by Bjarke Viksoe.
Article submitted 6/1/2008.