Difference between revisions of "Win32TaskbarProgress"
From Lazarus wiki
Jump to navigationJump to search (→About) |
|||
Line 22: | Line 22: | ||
In the form's OnShow (or maybe OnCreate) create the object like this: | In the form's OnShow (or maybe OnCreate) create the object like this: | ||
− | + | <syntaxhighlight lang="pascal"> | |
− | + | uses | |
+ | win32taskbarprogress; | ||
− | + | procedure TForm1.FormShow(Sender: TObject); | |
− | + | begin | |
− | + | GlobalTaskbarProgress:= TWin7TaskProgressBar.Create; | |
− | + | end; | |
+ | </syntaxhighlight> | ||
And then call properties of this object like this: | And then call properties of this object like this: | ||
− | + | <syntaxhighlight lang="pascal"> | |
− | + | //to change state: none, green, yellow, red, floating | |
+ | GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex); | ||
− | + | //to change progress value 0 to 100 | |
− | + | GlobalTaskbarProgress.Progress:= Edit1.Value; | |
+ | </syntaxhighlight> | ||
=Download= | =Download= | ||
Unit file and demo project: https://github.com/Alexey-T/Win32TaskbarProgress | Unit file and demo project: https://github.com/Alexey-T/Win32TaskbarProgress |
Revision as of 06:34, 25 December 2020
This article applies to Windows only.
See also: Multiplatform Programming Guide
About
This is unit which contains the class to control the progressbar over the Windows 7+ taskbar button. The demo looks like this:
Taskbar button can be colored in several ways:
- none (inactive)
- green progress
- yellow progress (looks like paused state)
- red progress (looks like error state)
- marquee floating animation (progress value is ignored, it's constantly changing animation from min to max)
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