如何使用系统对话框图标加载imagelist [英] How to load imagelist with system dialog icons

查看:73
本文介绍了如何使用系统对话框图标加载imagelist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用对话框中Windows使用的所有系统图标(警告,错误,信息,确认等标准图标)加载 TCustomImageList

How to load a TCustomImageList with all system icons used by Windows in dialog boxes (Standard icons like warning, error, information, confirmation..)?

我想找到一个适用于Windows XP的解决方案和更高版本。

I would like to find a solution which works on Windows XP and later.

推荐答案

请参见 LoadImage LoadIcon

See LoadImage and LoadIcon.

快速示例:

procedure TForm1.Button2Click(Sender: TObject);
var
  t_Icon: TIcon;

begin
  t_Icon := TIcon.Create();
  t_Icon.Handle := LoadImage( 0, MAKEINTRESOURCE(32513), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE or LR_SHARED );

  if ( t_Icon.Handle <> 0 ) then
    ImageList1.AddIcon( t_Icon );

// .............

  t_Icon.Free();
end;

这篇关于如何使用系统对话框图标加载imagelist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆