Difference between revisions of "Win32TaskbarProgress/zh CN"

From Lazarus wiki
Jump to navigationJump to search
Line 45: Line 45:
 
作者尝试在 win32taskbarprogress 的 "initialization" 部分初始化对象,但是失败了,可能是因为 Application.Handle 不能这么早地被初始化
 
作者尝试在 win32taskbarprogress 的 "initialization" 部分初始化对象,但是失败了,可能是因为 Application.Handle 不能这么早地被初始化
  
=Download=
+
=下载=
  
Unit file and demo project: https://github.com/Alexey-T/Win32TaskbarProgress
+
单元文件和示例工程: https://github.com/Alexey-T/Win32TaskbarProgress

Revision as of 06:54, 29 December 2020

Windows logo - 2012.svg

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:

Win32TaskbarProgressDemo.png

Taskbar button progress can have several styles:

  • 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

用法

在窗体的 OnShow (或者 OnCreate) 中创建对象,像这样:

uses
  win32taskbarprogress;

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

接下来,调用这个对象的属性,像这样:

  //来更改状态: none, green, yellow, red, floating
  GlobalTaskbarProgress.Style:= TTaskBarProgressStyle(ComboBoxStyle.ItemIndex);
 
  //来更改进度值:0 到 100
  GlobalTaskbarProgress.Progress:= Edit1.Value;

作者尝试在 win32taskbarprogress 的 "initialization" 部分初始化对象,但是失败了,可能是因为 Application.Handle 不能这么早地被初始化

下载

单元文件和示例工程: https://github.com/Alexey-T/Win32TaskbarProgress