Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Andy_Bell
Posted - Aug 27 2020 : 18:17:03 Hi
I'm using the Windows function ExtractIcon(...) to return a HICON handle to an executable file's first Icon resource.
Currently, I'm having to load it into a TImage using its Picture->Icon->Handle property and then save it to a temp file before loading into ImageEn.
It seems convoluted but I looked at TIEResourceExtractor and that seemed far more complex than I needed. I was also unable to figure out a way to reliably get the same icon that ExtractIcon was returning.
Questions:
Can I load the Icon returned by ExtractIcon into ImageEn - that is just from the Icon Handle?
Is there a simple way to use TIEResourceExtractor to do this?
Andy
Andy
3 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Aug 30 2020 : 22:57:57 Hi Andy
Well the other option is to get a TIcon object from the hicon value (lots of code on the web for this).
Error: Unresolved external '__fastcall Bmpfilt::IEConvertIconToBitmap(void *,Iexbitmaps::TIEBitmap *,Bmpfilt::TInvalidJumboIconAction)' referenced from 'ExternalEditors.obj'
Even if I include bmpfilt.pas in my project, I still get the error. C++ Builder 2007
The function is not in Image En Library file - I'm statically linking... If I include bmpfilt.pas in my project, bmpfilt.obj contains no accessible methods... Weird. My Delphi is not good enough to fix this, I'm afraid.
Is there a define I need to make to get the function included?
ADD: I can create a delphi project in RAD Studio 2007 and call the function ok. But not in Builder.
Andy
xequte
Posted - Aug 27 2020 : 19:33:49 Hi Andy
The method is not documented, but you can just use IEConvertIconToBitmap in the bmpfilt unit.