| View previous topic :: View next topic |
| Author |
Message |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Oct 29, 2007 5:50 pm Post subject: Browse for icons in DLL or EXE? |
|
|
Has anyone, or does anyone remember anyone doing code for browsing icons in dll or exe files with VDS???
Thanks in advance,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Mon Oct 29, 2007 8:51 pm Post subject: |
|
|
Hi Garret
If you want looking the icons in a dll or exe file you can do that:
| Code: | | dialog set,bitmap1,file.???|x |
where "file.???" is the dll or exe file and "x" is the icon's order.
Look, this way:
| Code: | dialog title, Test icons
DIALOG CREATE,Test icons,-1,0,240,370
DIALOG ADD,BITMAP,ico1,20,27,32,32
DIALOG ADD,BITMAP,ico2,54,27,32,32
DIALOG ADD,BITMAP,ico3,88,27,32,32
DIALOG ADD,BITMAP,ICO4,122,27,32,32
DIALOG ADD,BITMAP,ico5,156,27,32,32
DIALOG ADD,BITMAP,ico6,190,27,32,32
DIALOG ADD,BITMAP,ico7,224,27,32,32
DIALOG ADD,BITMAP,ico8,258,27,32,32
DIALOG ADD,BITMAP,ico9,292,27,32,32
DIALOG ADD,BITMAP,ico10,326,27,32,32
DIALOG SHOW
%a = 0
%d = @windir(system)\shell32.dll
repeat
dialog set,ico@succ(%a),%d|%a
%a = @succ(%a)
until @equal(%a,10)
wait event |
It's possible to see the first ten icons of shell32.dll (in system32 directory)
This way I do it in my "IcoPag" (http://vds.uvedese.es/index.php?option=com_content&task=view&id=116&Itemid=5) application for look icons in files.
Good luck
____________
uVeDeSe
_____________
Last edited by uvedese on Wed Apr 02, 2008 7:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Oct 30, 2007 7:27 am Post subject: |
|
|
I have an application that I wrote for browsing icon resources in executables
and dynamic link libraries. It will display all icons found within a specified
file, but I haven't implemented any further functionality. If your interested
I'll upload it here for all to use. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Oct 30, 2007 7:30 am Post subject: |
|
|
Yeah, that's kind of what I need for my app launcher program now. Someone mentioned I should add that ability, especially if there is no icon in the exe that's being used for one of the buttons to launch it.
Thanks a bunch,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Oct 30, 2007 7:41 am Post subject: |
|
|
Icon Browser has been uploaded to VdsWorld. It can be downloaded
from here _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Oct 31, 2007 9:11 pm Post subject: |
|
|
Hey, that's pretty sweet!
Now how are you determining how many icons are in the dll or exe?
Thanks,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Oct 31, 2007 9:17 pm Post subject: |
|
|
Icon Browser is written in C for starters. I haven't looked at the source
code in some time and I can't tell you off the top of my head. I can look
to see however. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Oct 31, 2007 9:38 pm Post subject: |
|
|
I'm using native APIs to do this so it can be done in VDS 5. Both of the
following APIs are in shell32.dll.
To get the count of icons in an exe/dll/ico file:
| Code: |
ExtractIcon(HINSTANCE, LPCTSTR, UINT);
HINSTANCE -> handle to the calling apps instance
LPCTSTR -> path to exe/dll/ico file
UINT -> set to '-1'
|
To get handles to the actual icons from exe/dll/ico file:
| Code: |
ExtractIconEx(LPCSTR, int, HICON, HICON, UINT);
LPCSTR -> path to the exe/dll/ico file
int -> index of the icon to get
HICON -> handle for large icon
HICON -> handle for small icon
UINT -> number of icons to get. Set to '1'.
|
That's pretty much it. Obviously to get all icons from an exe/dll/ico file
you will need to loop calling the ExtractIconEx() API just changing the 'int'
parameter to the index number of the icon you wish to get. Icon Browser
is also using 2 image lists to store the icon handles so they can be displayed
in a ListView control. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Oct 31, 2007 9:47 pm Post subject: |
|
|
Thanks a bunch
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Oct 31, 2007 9:52 pm Post subject: |
|
|
Was glad to help.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|