Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show Icons from resource file?

Status
Not open for further replies.

TomasDill

IS-IT--Management
Sep 2, 2000
703
UA
Interesting question. VFP works with pictires as with files only. Is there way to get picture from resource file and show it, for example, as picture on button? Resource file I meant EXE, DLL etc. For example, In Windows explorer you may specify deskctop Icon as 'Winword.exe,1', that means take default icon for Winword.exe application. How to do the same in VFP in run-time? [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
You might take a look at the ImageList ActiveX control; its images can be bound to anything that supports the Picture property, but I don't know if it can pull images from within resource files. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Robert, how this could be done? Say, I have an Image List control (or some other control) that contains images. HOW show this image in the button, for example? AFAIK Picture property accepts only characters that is file name... [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Hi Vlad,

picture from resource file and show it

AFAIK, No. You can extract an icon handle from an exe or dll and draw the image on a form, but can't create a disk file with it.

If you are trying to do this programmatically(on-the-fly), you might be able to build a dll in C++ to do this. I havent tried this, but it might be possible.

If you only need to do this manually and you have Visual C++, you can open the exe or dll as a resource file, select the icon, copy & paste it into VFP's image editor and save it as an .ico file. Distribute that with your app. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
All that I need - just show a combobox with registered file types in Windows. I can read file types and corresponding EXE files from registry. However, As I said, icons referred in registry as 'WINWORD.EXE,1' for example. So, how to show file icon in combobx?
Well, this might be possible at all, even when I need to make hacking code :) However, I trying to find more reliable and simple way. [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top