Win32TaskbarProgress: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Win32TaskbarProgress
| Old | New | Line | |
|---|---|---|---|
| 1 | + | *(Windows only)* | |
| 2 | + | ||
| 3 | + | ## About | |
| 4 | + | ||
| 5 | + | This is unit which contains the class to control the progressbar over the Windows 7+ taskbar button. The demo looks like this: | |
| 6 | + | ||
| 7 | + |  | |
| 8 | + | ||
| 9 | + | Taskbar button progress can have several styles: | |
| 10 | + | ||
| 11 | + | - none (inactive) | |
| 12 | + | - green progress | |
| 13 | + | - yellow progress (looks like paused state) | |
| 14 | + | - red progress (looks like error state) | |
| 15 | + | - marquee floating animation (progress value is ignored, it's constantly changing animation from min to max) | |
| 16 | + | ||
| 17 | + | ## Author | |
| 18 | + | ||
| 19 | + | Alexey Torgashin | |
| 20 | + | ||
| 21 | + | ## License | |
| 22 | + | ||
| 23 | + | MIT | |
| 24 | + | ||
| 25 | + | ## Usage | |
| 26 | + | ||
| 27 | + | In the form's OnShow (or maybe OnCreate) create the object like this: | |
| 28 | + | ||
| 29 | + | ``` pascal | |
| 30 | + | uses | |
| 31 | + | win32taskbarprogress; | |
| 32 | + | ||
| 33 | + | procedure TForm1.FormShow(Sender: TObject); | |
| 34 | + | begin | |
| 35 | + | GlobalTaskbarProgress:= TWin7TaskProgressBar.Create; | |
| 36 | + | end; | |
| 37 | + | ``` | |
| 38 | + | ||
| 39 | + | And then call properties of this object like this: | |
| 40 | + | ||
| 41 | + | ``` pascal | |
| 42 | + | //to change state: none, green, yellow, red, floating | |
| 43 | + | GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex); | |
| 44 | + | ||
| 45 | + | //to change progress value 0 to 100 | |
| 46 | + | GlobalTaskbarProgress.Progress:= Edit1.Value; | |
| 47 | + | ``` | |
| 48 | + | ||
| 49 | + | Author tried to initialise the object in the "initialization" part of win32taskbarprogress, but failed, maybe because the Application.Handle is not initialised so early. | |
| 50 | + | ||
| 51 | + | ## Download | |
| 52 | + | ||
| 53 | + | Unit file and demo project: <https://github.com/Alexey-T/Win32TaskbarProgress> | |
| 54 | + | ||
| 55 | + | --- | |
| 56 | + | *From the Free Pascal wiki, page "Win32TaskbarProgress", as it stood on 2021-11-09 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 57 | + | Category: Code Snippets | |
| 58 | + | Category: Components | |
| 59 | + | Category: Lazarus | |
| 60 | + | Category: Windows |
