简体   繁体   中英

How to load imagelist with system dialog icons

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

在此输入图像描述

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

See LoadImage and LoadIcon .

Quick example:

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM