I am working on a small c
project , it is a menu that contains all
the programs that the user have .
so i need a batch script that
- takes the the program's name or path
- returns the full path of it's icon . can you help ?
I am working on a small c
project , it is a menu that contains all
the programs that the user have .
so i need a batch script that
This is not an impossible task (after all, Windows does it!). Typically, a program's icon is specified in one of two places: within the program binary itself, or in the shortcut to the program.
Within the program binary: Windows programs (EXEs and DLLs) use a format called Portable Executable (PE) format. This file format specifies the organization of code and data for programs. Icons would be stored somewhere in here. So, you would need to parse the PE format in order to get the icon. Thankfully, it looks like Windows provides a function for getting icons: ExtractIconEx. You might use this to get an icon from a program. Here's an article I found that has some commentary on that function. Some of the links in it are dead--Google is your best friend.
In the shortcut: Here is an already answered StackOverflow question about getting icons from shortcuts. Something in there might be helpful.
Some additional comments:
I hope this helps.