请问如何在图标中显示进度条,像winrar在后台执行时那样?服务程序很需要. 像winrar在后台执行时那样,显示进度条,不会是每个刻度用一个ico图像吧?如果用绘图实现,托盘程序如何在运行时给“自己的”图标绘图? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 运行时动态画程序图标,甚至可做成动画:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;type TForm1 = class(TForm) Timer1: TTimer; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Timer1Timer(Sender: TObject); private vHICO:HICON; Img1: TImage; Img2: TImage; Img3: TImage; { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);begin Img1:= TImage.Create(Self); Img2:= TImage.Create(Self); Img3:= TImage.Create(Self); Img1.Height :=32; Img1.Width :=32; Img2.Height :=32; Img2.Width :=32; Img3.Height :=32; Img3.Width :=32; DrawIcon(Img1.Canvas.Handle,0,0,Application.Icon.Handle); Img3.Canvas.Brush.Color:=clBtnFace; Img3.Canvas.FillRect(Img3.ClientRect);end;procedure TForm1.FormDestroy(Sender: TObject);begin if vHICO<>0 then DestroyIcon(vHICO);end;procedure TForm1.Timer1Timer(Sender: TObject);var aicf:ICONINFO; X:integer; aRect:TRect;begin X:=Random(100); Img2.Picture.Bitmap.Assign(Img1.Picture.Bitmap); aRect.Left :=8; aRect.Right :=25; aRect.Bottom:=32; aRect.Top :=2+(X * 30 div 100); Img2.Canvas.Brush.Color:=clBlue; Img2.Canvas.FillRect(aRect); GetIconInfo(Application.Icon.Handle,aicf); //aicf.fIcon:=True; //aicf.xHotspot:=16;aicf.yHotspot:=16; aicf.hbmMask :=Img3.Picture.Bitmap.Handle; aicf.hbmColor:=Img2.Picture.Bitmap.Handle; if vHICO<>0 then DestroyIcon(vHICO); vHICO:=CreateIconIndirect(aicf); Application.Icon.Handle := vHICO; //DestroyIcon(vHICO); //vHICO:=0;end;end. DBCHART 如何动态设置它的数据源,X,Y轴? 排序问题 规求关于统计单词的问题,散高分在线等,高手一定要帮忙 请问:怎么计算DBGrid中某列数据的总和及平均值? strongly protest that bbs owner delete articles according no reason. 如何知道一个消息的发送者 一个不知道原因的问题!求各位高人解答原因!(100分) 会打印的大侠请帮忙看看!!!!!!!!!!!!! delphi结构化存储中的流删除 调用 包含GIF图片的窗口DLL时,GIF不能动作? 软件进行多个数据库登录问题? 在delphi里面怎样写二叉树的算法?
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
vHICO:HICON;
Img1: TImage;
Img2: TImage;
Img3: TImage;
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
Img1:= TImage.Create(Self);
Img2:= TImage.Create(Self);
Img3:= TImage.Create(Self);
Img1.Height :=32;
Img1.Width :=32;
Img2.Height :=32;
Img2.Width :=32;
Img3.Height :=32;
Img3.Width :=32;
DrawIcon(Img1.Canvas.Handle,0,0,Application.Icon.Handle);
Img3.Canvas.Brush.Color:=clBtnFace;
Img3.Canvas.FillRect(Img3.ClientRect);
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
if vHICO<>0 then
DestroyIcon(vHICO);
end;procedure TForm1.Timer1Timer(Sender: TObject);
var aicf:ICONINFO;
X:integer;
aRect:TRect;
begin
X:=Random(100);
Img2.Picture.Bitmap.Assign(Img1.Picture.Bitmap);
aRect.Left :=8;
aRect.Right :=25;
aRect.Bottom:=32;
aRect.Top :=2+(X * 30 div 100);
Img2.Canvas.Brush.Color:=clBlue;
Img2.Canvas.FillRect(aRect);
GetIconInfo(Application.Icon.Handle,aicf);
//aicf.fIcon:=True;
//aicf.xHotspot:=16;aicf.yHotspot:=16;
aicf.hbmMask :=Img3.Picture.Bitmap.Handle;
aicf.hbmColor:=Img2.Picture.Bitmap.Handle;
if vHICO<>0 then
DestroyIcon(vHICO);
vHICO:=CreateIconIndirect(aicf);
Application.Icon.Handle := vHICO;
//DestroyIcon(vHICO);
//vHICO:=0;
end;end.