| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| C++ and WinAPI Discuss Windows API related issues using C++ (and Visual C++). This is a non-MFC forum. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Taking .exe icons and using them in my app.
I'm making a little program that just makes my desktop a whole lot cleaner. To do this, I'm using a listbox dialog. When you select the appropriate item in the list, it opens the program.
I want this to be as dynamic as I possibly can have it. I'd also like it to look very stylish, and display the proper icon in relation to the given program. So, Is there any way I can get the icon data from a .exe file, and load it into my ImageList component? |
|
#2
|
||||
|
||||
|
Re: Taking .exe icons and using them in my app.
Have a look at ExtractIcon(Ex) API
__________________
Victor Nijegorodov
|
|
#3
|
||||
|
||||
|
Re: Taking .exe icons and using them in my app.
Read this page: http://msdn.microsoft.com/en-us/libr...68(VS.85).aspx
|
|
#4
|
|||
|
|||
|
Re: Taking .exe icons and using them in my app.
After much work(and a huge break from the project) I finally have an HICON handle ready to use.
After lots and lots of searching, I can't seem to find a working method to inject it into my Imagelist control. Help much appreciated! Last edited by Jakman4242; October 17th, 2009 at 02:05 AM. |
|
#5
|
||||
|
||||
|
Re: Taking .exe icons and using them in my app.
And how did you try it?
__________________
Victor Nijegorodov
|
|
#6
|
|||
|
|||
|
Re: Taking .exe icons and using them in my app.
Most of it involved trying to get the HICON handle and put that into a Bitmap instance.
The big problem in this was, whenever I tried using the function Bitmap::FromHicon() I'd get the following error, as if the function was protected? Code:
HICON exticon = ExtractIcon(0, str, 0); Bitmap bmp; bmp.FromHicon(exticon); [error C3767: 'System::Drawing::Bitmap::Bitmap': candidate function(s) not accessible] |
|
#7
|
||||
|
||||
|
Re: Taking .exe icons and using them in my app.
Quote:
__________________
Victor Nijegorodov
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|