setTaskBarState

setTaskBarState(state: Integer);

The setTaskBarState method of the Form class sets the state of the taskbar icon for the application.

If the method is called:

This functionality is available only if the application displays an icon on the Windows taskbar. It does not apply to icons in the system tray.

The method call can silently fail for some earlier versions of Windows (for example, Windows 8.0), even though the Microsoft documentation states that the functionality is available from Windows 7 and later.

The state parameter of this method can contain one of the Form class constants listed in the following table.

Form Class Constant Value Description
TaskBar_State_NoProgress 0 Hides the progress state on the icon
TaskBar_State_Indeterminate 1 Causes a continuous icon progress state, drawing the state in green from 0 through 100 percent, repeated, indicating the action is in progress but the progress completion time is unknown
TaskBar_State_Normal 2 Displays the current progress state in green
TaskBar_State_Error 4 Sets the progress state to be drawn in red to indicate an error state
TaskBar_State_Paused 8 Displays the current progress state in yellow, to indicate that the action has been paused

Any other value passed to the setTaskBarState method is treated as TaskBar_State_Normal (2).

2018.0.01 and higher