News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Executable file icon

Started by azdps, March 23, 2011, 08:36:13 PM

Previous topic - Next topic

azdps

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.

Vortex

Hi azdps,

Without a resource section, windows explorer can only display the default exeutable icon.

azdps

that clears things up. thank you.


donkey

Quote from: jj2007 on March 24, 2011, 06:17:05 AM
But check what Edgar has to say on the topic.

That was to use an icon to display in a static control, this thread is for the application icon, they are pretty different things.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jj2007

I know. Strange that Windows makes it so difficult to use another's app icon - security?
Workaround: GetWindowDC  :wink

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

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

lingo

azdps,
just take a look here... :wink

donkey

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...
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable