W
wangzf
Unregistered / Unconfirmed
GUEST, unregistred user!
在线程中产生var filename:String;cout:integer两个变量,传入以下过程,如何表述???
procedure TfrmMailForm.ADrawItem(Sender:TObject;ACanvas:TCanvas;ARect:TRect;Selected:Bool;var filename:String;cout:integer);
var
i:integer;
sinfo:SHFILEINFO;
begin
ZeroMemory(@sinfo,sizeof(sinfo));
SHGetFileInfo(PChar(GetfileExt(filename)),FILE_ATTRIBUTE_NORMAL,sinfo,sizeof(sinfo),SHGFI_USEFILEATTRIBUTES OR SHGFI_ICON);
for i:=0 to coutdo
begin
ePic:=TPicture.Create;//创建一个用于装载图片的Tpicture对象
ePic.Icon.Handle:=sinfo.hIcon;//从项目所在目录装载图片
acanvas.Draw(arect.Left,arect.Top,ePic.Graphic);//将图片在菜单项中绘制出来
acanvas.Font.Size:=10;//设置菜单项的字体大小
acanvas.Font.Color:=clblue;
//设置菜单项字体颜色
acanvas.TextOut(arect.Left+40,arect.Top+15,filename);//在菜单项中输出文字A
end;
end;
procedure TfrmMailForm.ADrawItem(Sender:TObject;ACanvas:TCanvas;ARect:TRect;Selected:Bool;var filename:String;cout:integer);
var
i:integer;
sinfo:SHFILEINFO;
begin
ZeroMemory(@sinfo,sizeof(sinfo));
SHGetFileInfo(PChar(GetfileExt(filename)),FILE_ATTRIBUTE_NORMAL,sinfo,sizeof(sinfo),SHGFI_USEFILEATTRIBUTES OR SHGFI_ICON);
for i:=0 to coutdo
begin
ePic:=TPicture.Create;//创建一个用于装载图片的Tpicture对象
ePic.Icon.Handle:=sinfo.hIcon;//从项目所在目录装载图片
acanvas.Draw(arect.Left,arect.Top,ePic.Graphic);//将图片在菜单项中绘制出来
acanvas.Font.Size:=10;//设置菜单项的字体大小
acanvas.Font.Color:=clblue;
//设置菜单项字体颜色
acanvas.TextOut(arect.Left+40,arect.Top+15,filename);//在菜单项中输出文字A
end;
end;