: : This message was edited by jobromedia at 2005-12-6 21:59:25
: : : You could try the TBitmap.LoadFromResourceID() or TBitmap.LoadFromResourceName() methods. Or try to get the icon handle using LoadIcon() API function, which you cn then assign to the TIcon.Handle property.
: : :
: : I'm totally out in the blue here.
: : bmp.LoadFromResourceID(what,what)
: : Sorry for being so noob here, but if I can't get a explanation in plain english then I just have to hack the resources out, and guessing the ID isn't an easy task either.
: I've found that you can cannot use this function to load the icon into a bitmap. You can however use the similar LoadIcon() API function to get the handle of the icons.
: The hInstance handle is returned by the LoadLibrary() API function. If you use the ID's for the icons instead of their names, then it is quite simple to figure out which icon is which.
: In the windows explorer: if you change the icon of a program/link file you get a complete gallery of all the icons within that file. These are numbered starting with 1 in the top left corner. For the shell32.dll file these are:
: 1 Unknown file type
: 2 Text Document
: 3 Console program
: 4 Closed Folder
: 5 Opened Folder
: 6 5.25" Floppy
: 7 3.5" Floppy
: Now for a simple example: this code loads the icon for a networked drive into an image component:
: procedure TForm1.Button1Click(Sender: TObject);
: H: THandle;
: H := LoadLibrary('shell32.dll');
: Image1.Picture.Icon.Handle := LoadIcon(H, '#10');
: The #10 string indicates which icon to load.
Ah that simple, thanks a million for helping me out, I was beginning to pull my hair off...