EZSnakeCtrl-Indefinite Cyclic Progress control | CodeGuru

EZSnakeCtrl-Indefinite Cyclic Progress control

Environment: Visual C++ 6 (SP2), Windows 98 I got the hunch from Netscape’s progress control in the status bar. Since most of the complexity is hidden in the implementation, using this is as easy as using a normal progress bar. This control is not derived from CProgressBarctrl but from CStatic to ensure simplicity and efficiency. […]

Written By
CodeGuru Staff
CodeGuru Staff
Jul 27, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Visual C++ 6 (SP2), Windows 98

I got the hunch from Netscape’s progress control in the status bar.
Since most of the complexity is hidden in the implementation, using this
is as easy as using a normal progress bar. This control is not derived
from CProgressBarctrl but from CStatic to ensure simplicity and efficiency.
An imitation of Netscape status bar as well as a dialog based demo like
that of CGradientProgress is included in the sample zip file. If
this control is used in a dialog box, simply put a CStatic Place holder
in the dialog and subclass it to CEZSnakeCtrl. Now you can customize the
look & feel of the control. Various options available are:

 //Get & Set The Maximum value of the progress control
 //0 is assumed as the minimum.
 int GetMax();
 void SetMax(int nMax);
 //Get & Set the size of the snake
 int GetSize();
 void SetSize(int nSize);
 //Get & Set the the Steps ->unit increment
 int GetStep();
 void SetStep(int nStep);
 //Get The Head Position
 int GetPos();
 //Get The tail position
 int GetTail();
 //Get the direction of the snake
 BOOL IsReverse();
 //Get & Set the Gradient begin & end colors
 COLORREF GetGradientEndColor();
 COLORREF GetGradientStartColor();
 void SetGradientFill(COLORREF clrStart,COLORREF clrEnd);
 //Get & Set Background color
 COLORREF GetBkColor();
 void SetBkColor(COLORREF clrFG);
 //Operations<>BR
 int StepIt();//Move the snake.
 void ResetProgress();//reset the snake

I think the demo project can do rest of the explaining.

Downloads


Download demo project – 71 Kb

Download source – 3 Kb
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.