Win32TaskbarProgress

From Lazarus wiki
Revision as of 06:27, 25 December 2020 by Alextp (talk | contribs) (→‎Usage)
Jump to navigationJump to search

About

This is unit which contains the class to control the progressbar over the Windows 7+ taskbar button. The demo looks like this:

Win32TaskbarProgressDemo.png

Taskbar button can be colored in several ways: green progress, yellow progress (paused), red progress (error state), and marquee floating state (with non-fixed value, it's constantly changing value).

Author: Alexey Torgashin

License: MIT

Usage

In the form's OnShow (or maybe OnCreate) create the object like this:

uses
  win32taskbarprogress;
procedure TForm1.FormShow(Sender: TObject);
begin
  GlobalTaskbarProgress:= TWin7TaskProgressBar.Create;
end;

And then call properties of this object like this:

//to change state: none, green, yellow, red, floating
GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex);

//to change progress value 0 to 100
GlobalTaskbarProgress.Progress:= Edit1.Value;

Download

Unit file and demo project: https://github.com/Alexey-T/Win32TaskbarProgress