Mega Code Archive

 
Categories / Delphi / Examples
 

Iconsandbuttonbitmaps

See also BitMaps.txt ***************************************************************************************** Web sites with lots of icons: Look for a file called RZBmps.zip on www.raize.com Nice images there. Also: http://www.iconbazaar.com http://www.purescience.com/delphi/download.htm http://www.cobblink.com/extra/iconcity.zip http://socrates.berkeley.edu/~dta95/icons/icons.htm http://www.iconnews.freeserve.co.uk/ http://Inner-Smile.com http://members.xoom.com/kakoulidis/D_Massive.html [this download is 10Mb+...] http://www.whitis.com/download.htm And Richey's Delphi Box has some, I believe. ***************************************************************************************** Create icon from resource: [see also file with 'resource' in the name...] Oops so simple really, just couldn't find the right info where I was looking for it. To return your own HICON: Add this to your unit to include a Resource file with the units name and a .RES extension {$R *.RES} Then just call: Result := LoadIcon(hInstance, ICON_TAG); Where ICON_TAG is the string name of the icon in the Resource file. hInstance is an application level variable provided by windows for your application or library, defined in SysInit. I wrote: > How do I load and return a handle to an icon? I am working with the ToolsAPI and a function requires a HICON. Michael Darling ROOM UNDERWRITING SYSTEMS LTD. mailto:MXDarling@roomuw.co.uk ***************************************************************************************** > How do I load and return a handle to an icon? I am working with the > ToolsAPI and a function requires a HICON. > > I therefore want to include an icon I've created that will be stored as > a resource in my package that I can load perhaps using > CreateIconFromResource? or whatever? See the LoadIcon API funcion. Provide the instance handle and the name of the resource. You can also use the LoadImage function. Don't forget to call DestroyIcon when you're finished, unless the ToolsAPI is supposed to take ownership of the handle.