how do you set the executable file icon using a system icon from shell32.dll? i can set the little icon shown in the caption bar and also the system tray but for some reason my executable icon doesn't show. also i don't want to use a resource file. thank you.
Hi azdps,
Without a resource section, windows explorer can only display the default exeutable icon.
that clears things up. thank you.
But check what Edgar has to say on the topic (http://www.masm32.com/board/index.php?topic=12313.msg94428#msg94428).
Quote from: jj2007 on March 24, 2011, 06:17:05 AM
But check what Edgar has to say on the topic (http://www.masm32.com/board/index.php?topic=12313.msg94428#msg94428).
That was to use an icon to display in a static control, this thread is for the application icon, they are pretty different things.
I know. Strange that Windows makes it so difficult to use another's app icon - security?
Workaround: GetWindowDC :wink
Quote from: jj2007 on March 24, 2011, 07:13:28 AM
I know. Strange that Windows makes it so difficult to use another's app icon - security?
Workaround: GetWindowDC :wink
More likely no field in the PE spec to store it, in a shortcut the path to the icon's parent and the index are stored directly in the lnk file. If you wanted to assign other icons to an executable you could use ADS data streams on NTFS drives to store the path and index (or the whole icon), that way there would be no editing on the PE file directly (well in reality yes but Windows doesn't see it that way). You could then write a shell extension to extract the information and change the icon. Its about the only way I can see to do it.
i don't think any of those methods will change the appearance of the exe file in explorer, though (see original post)
i guess a simple windows shortcut may help
create a shortcut to the exe - you can set the shortcut icon to anything you like :P
azdps,
just take a look here (http://www.shelllabs.com/)... :wink
Hi Lingo,
First off, I haven't taken a look at it since its something that I can do by a simple registry edit or in older Windows using properties. I doubt very highly that they have found some magical way to change an executables icon when it has no resource section to hack. Most likely it just sets the associated icons for a given file type and I'm sure that azdps doesn't want to change the default icon for all executables. Hard to believe that they think they can make money ($25.00) off of something that is exceedingly simple to do even for a beginner. Its really not much more than a GUI wrapper around 1 or 2 beginner level functions, if it was mine (and I don't know that they don't do this) I would extract the icon and create an icon library and use that as the index, that way you could remove the original program without losing your icon, a few copyright issues though...