Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips

#84: How can I load the icons from external dll/exe?

Exists a few ways to store the some icons in external files and load them in run-time. For example, the next code shows how you can load the icons from dll/exe file:

procedure TyourForm.btnFillIconsClick(Sender: TObject);
  i: Integer;
  pcDLLName: PChar;
  pcDLLName := 'MORICONS.DLL';
  for i := 0 to ExtractIcon(Handle, pcDLLName, Cardinal(-1)) - 1 do
    ImageList_AddIcon(yourImageList.Handle, ExtractIcon(Handle, pcDLLName, i));

This method is useful when you want to load the some system icons or from own dynamic library in which you placed the collection of icons.

If you needs to load the icons in run-time but you don't want to use the external file, you can place the glyph collection into resource file and link it in own exe-file. How to do it I'll show in the next tip.

Published: June 12, 2000

See also
SMExport suite
Clarion Viewer
ExcelFile Viewer
ABA Picture Convert
Viewer for MS Outlook Messages
Paradox to Text converter
Mail parser (ActiveX)
DBISAM Password Recovery
Paradox Viewer

Contact to webmaster


Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2016, Scalabium Software. All rights reserved.

SMExport/SMImport suites