Scalabium Software |
|
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); var i: Integer; pcDLLName: PChar; begin pcDLLName := 'MORICONS.DLL'; for i := 0 to ExtractIcon(Handle, pcDLLName, Cardinal(-1)) - 1 do ImageList_AddIcon(yourImageList.Handle, ExtractIcon(Handle, pcDLLName, i)); end; 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.
|
Copyright© 1998-2024, Scalabium
Software. All rights reserved. |