unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs, System.Win.Taskbar,
Vcl.StdCtrls;
type
TForm1 =
class(TForm)
btnOverlay: TButton;
btnDeleteOverlay: TButton;
procedure btnDeleteOverlayClick(Sender: TObject);
procedure btnOverlayClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FTaskBar: System.Win.Taskbar.TWinTaskbar;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnDeleteOverlayClick(Sender: TObject);
begin
FTaskBar.SetOverlayIcon(0, '
');
end;
procedure TForm1.btnOverlayClick(Sender: TObject);
var
Icon: TIcon;
begin
Icon := TIcon.Create;
try
Icon.LoadFromResourceName(HInstance, '
MAINICON');
if Icon.Width >= 16
then
FTaskBar.SetOverlayIcon(Icon.Handle, '
Beispiel');
finally
Icon.Free;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FTaskBar.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FTaskBar:= System.Win.Taskbar.TWinTaskbar.Create;
FTaskBar.MainWindow := Self.Handle;
end;
end.