K,真奇怪!!!

xzm2000 2001-09-19 12:45:04
ICount := Integer(ExtractIcon(Handle, 'FileName', -1));
取得图标总数,编译通不过
ExtractIcon(Handle, 'FileName', 0);
取得第一个图标handle,没问题

sdk帮助中明明有这样一句
Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1, the function returns the total number of icons in the specified file.

tmd就是编译通不过,什么原因?
...全文
135 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
TechnoFantasy 2001-09-19
  • 打赏
  • 举报
回复
因为ExtractIcon在Delphi定义中定义为UInt,你使用-1当然通不过,另外ICount定义为HICON
比较好。
TechnoFantasy 2001-09-19
  • 打赏
  • 举报
回复
将ICount := Integer(ExtractIcon(Handle, 'FileName', -1)); 改为
ICount := ExtractIcon(Application.Handle, 'C:\WINNT\regedit.exe', UINT(-1));
BS 2001-09-19
  • 打赏
  • 举报
回复
i:=-1;
ICount := Integer(ExtractIcon(Handle, 'FileName', i));
xzm2000 2001-09-19
  • 打赏
  • 举报
回复
错误:Constant expression violates subrange bounds
BS 2001-09-19
  • 打赏
  • 举报
回复
你也应把错误帖出来吧
xzm2000 2001-09-19
  • 打赏
  • 举报
回复
up

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧