Use the icon resource in shell32.dll

Source: Internet
Author: User

Uses
Windows, messages, sysutils, classes, graphics, controls, forms, shellapi, dialogs;

Type
Tform1 = Class (tform)
Procedure formcreate (Sender: tobject );
Procedure formclose (Sender: tobject; var action: tcloseaction );
Private
{Private Declarations}
Public
{Public declarations}
End;

VaR
Form1: tform1;
Required topicon: timagelist; // create a list of your favorite images

Implementation

{$ R *. DFM}

Procedure tform1.formcreate (Sender: tobject );
VaR ICO: ticon;
SFI: tshfileinfo;
I: integer;
Begin

// Assign a handle to the image list

Required topicon: = timagelist. Create (Self );
Required topicon. Handle: = shgetfileinfo ('', 0, SFI, sizeof (tshfileinfo ),
Shgfi_sysiconindex or shgfi_smallicon );
Required topicon. Required images: = true;
For I: = 0 to operate topicon. Count-1 do
Begin
ICO: = ticon. Create;
Using topicon. getIcon (I, ico );
ICO. savetofile (C: \ icons \ + inttostr (I) +. ico );
ICO. Free;
End;
End;

Procedure tform1.formclose (Sender: tobject; var action: tcloseaction );
Begin
Optional topicon. Free;
End;

End.

Use the icon resource in shell32.dll

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.