|
-
August 21st, 2010, 09:42 PM
#1
Problem with FindResource
So, here's my problem. After two long days of hard-searching I couldn't find anything to help me on this. Basically I want to extract the default icon of an executable file.
I tried to use ExtractIcon function, but after I get the handle to an icon I couldn't find any way to get a pointer to that icon. I want to use that icon, not just show it using DrawIcon, so, I think ExtractIcon doesn't help me too much.
The next thing I've tried is to use FindResource, and it does seem to work when I try to load a custom resource added by me in a simple VB application, but when I'm trying to load some resources added with UpdateResource function it wouldn't find them. I am not even sure what I should use as a second and third parameter. On MSDN appears a MAKEINTRESOURCE function which exists only in C.
Initially I thought there is something wrong with my code, but then I've tried EnumResourceNames too (which wouldn't be a great solution to just extract one icon), and it doesn't return anything, except when I try it on that VB application I've mentioned before, and it returns a single result.
Btw, when I open that app with ResHack I can see all resources, including those I've added with UpdateResource, and also icons and stuff.
I am looking for a short code so I can understand it, nothing too fancy!
Thanks in advance for your responses.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|