Progress Bar – Giavapps Windows API

 

 

api_progressbar_create(ParentHandle, X, Y, W, H, Flags, ExFlags) This function creates a progress bar.

ParentHandle: parent handle.
X: x coordinate.
Y: y coordinate.
W: width.
H: height.
Flags: Flags of the control. Flags must be separated with the symbol "|".
ExFlags: extended flags of the control. Flags must be separated with the symbol "|".

 

Flags

 

This control supports the Window Styles and you can specify any of the styles listed below:

 

PBS_SMOOTH The progress bar displays progress status in a smooth scrolling bar instead of the default segmented bar.

PBS_VERTICAL The progress bar displays progress status vertically, from bottom to top.

 

Extended Flags

 

This control supports the Extended Window Styles.

 

Return Value

 

If the function succeeds, the return value is a handle to the new progress bar.

If the function fails, the return value is false.

To get extended error information, call api_control_get_last_error().

 

Control Functions

 

api_progressbar_set_range(ProgressBarHandle,Min,Max) Sets the minimum and maximum values for a progress bar and redraws the bar to reflect the new range.

ProgressBarHandle: it must be a ProgressBarHandle.
Min: minimum range value. This value must not be negative. By default, the minimum value is 0.
Max: maximum range value. This value must be greater than Min. By default, the maximum value is 100.

 

api_progressbar_get_range(ProgressBarHandle,MinOrMax) Returns the high or low limits of a given progress bar control. If the function fails, it returns 0.

ProgressBarHandle: it must be a ProgressBarHandle.
MinOrMax: minimum limit (false) or maximum limit (true).

 

api_progressbar_set_position(ProgressBarHandle,Position) Sets the current position for a progress bar and redraws the bar to reflect the new position. The function returns the previous position.

ProgressBarHandle: it must be a ProgressBarHandle.
Position: integer that becomes the new position.

 

api_progressbar_get_position(ProgressBarHandle) Returns the current position of the progress bar.

ProgressBarHandle: it must be a ProgressBarHandle.

 

Code Examples

 

Creating a Progress Bar

 

progressbar = api_progressbar_create(window,10,10,160,24,WS_VISIBLE | WS_CHILD | PBS_SMOOTH,0);

 

Creating a Vertical Progress Bar

 

progressbar = api_progressbar_create(window,10,10,24,160,WS_VISIBLE | WS_CHILD | PBS_VERTICAL,0);

 

Setting Range and Position

 

api_progressbar_set_range(progressbar,0,200);
api_progressbar_set_position(progressbar,100);

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*