Creating a Progress Bar

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

A progress bar is a common control that indicates the progress of a lengthy operation by displaying a colored bar inside a horizontal rectangle. The length of the bar, in relation to the length of the rectangle, corresponds to the percentage of the operation that is complete. The following screen shot shows a progress bar.

Aa930754.b7ea36ba-c7db-4833-957a-13ffe720296b(en-us,MSDN.10).gif

To create a progress bar

  1. Specify the PROGRESS_CLASS class in the lpClassName parameter of the CreateWindowEx function.

    This class is registered when the DLL for the common control is loaded. You can use the InitCommonControls function to ensure that this DLL is loaded. To register the class for the progress bar by using the InitCommonControlsEx function, specify the ICC_PROGRESS_CLASS flag as the dwICC member of the INITCOMMONCONTROLSEX structure that you pass in the lpInitCtrls parameter.

  2. Specify a style for the progress bar in the dwStyle parameter of the CreateWindowEx function.

See Also

Concepts

Working with Common Controls