为什么使用var
Icon:HIcon;
IconIndex:word;
begin
IconIndex:=1;
Icon:=ExtractAssociatedIcon(HInstance,PChar(Application.ExeName),IconIndex);
image1.Picture.Icon.Handle:=Icon;
end;可以显示出自己程序的图标,而使用var
Icon:HIcon;
IconIndex:word;
begin
IconIndex:=1;
Icon:=ExtractAssociatedIcon(HInstance,PChar('d:\temp\bbb\Project1.exe'),IconIndex);
image1.Picture.Icon.Handle:=Icon;
end;却不行呢.设断点后发现 Icon 值为零,且路径绝对正确!书上说把 IconIndex 值设为-1可返回图标总数,可一运行就提示 IconIndex 越界!
为什么这个函数这么奇怪呢???
Icon:HIcon;
IconIndex:word;
begin
IconIndex:=1;
Icon:=ExtractAssociatedIcon(HInstance,PChar(Application.ExeName),IconIndex);
image1.Picture.Icon.Handle:=Icon;
end;可以显示出自己程序的图标,而使用var
Icon:HIcon;
IconIndex:word;
begin
IconIndex:=1;
Icon:=ExtractAssociatedIcon(HInstance,PChar('d:\temp\bbb\Project1.exe'),IconIndex);
image1.Picture.Icon.Handle:=Icon;
end;却不行呢.设断点后发现 Icon 值为零,且路径绝对正确!书上说把 IconIndex 值设为-1可返回图标总数,可一运行就提示 IconIndex 越界!
为什么这个函数这么奇怪呢???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货