Re: Import exeutable icon



Hello, kalish.

Yes, it's possible. To add icon to application you need to add ICON
resource. Shell by default reads first ICON resource (with the smaller ID)
and shows it. BegineUpdateResource, UpdateResource and EndUpdateResource is
what you need.

--
Vladimir

"kalish" <kalsih@xxxxxxx> wrote in message
news:Og8IvI7MGHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
Following is quate on MSDN refernce regarding resources manipulation
(thanks
Mr.Sherbina). Following the doc I managed to import an exe to my VC
application, save it to the disk, and run it with ShellEcute.
My question - I want also to import its small icon that I see next to the
name in Explorer view. Is it possible and how?

Regards

Kalish

Following examples might help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
/WindowsUserInterface/Resources/IntroductiontoResources/UsingResources.asp#_
win32_Updating_Resources

They don't have working with files, but basics of reading/using resources
are described there.

--
Vladimir

"Kalish" <kalish@xxxxxxxx> wrote in message
news:OSSbeLiKGHA.2036@xxxxxxxxxxxxxxxxxxxxxxx
Accidently its an installation program so one may asume that the user has
administrator previlages. Is there any C/C++ example that doing something
similar.

Thanks

kalsih
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:0snau1hab8lajs3pb007klfu4bndp3rnur@xxxxxxxxxx
As Ajay points out, in order to execute the resource you need to store
it
as a .exe file.
This may not be possible. In fact, many anti-virus programs are
configured to forbid the
writing of executable files on the disk, and cannot be overridden by
anyone other than an
administrator. So this seems like a bad idea. When you do an install,
the person logged
in doing the installation has rights to do an installation, which means
writing executable
files on the disk. After that, it is just pure hope.

All of this seems to go back to the "I don't want to have anything more
complex than a
single executable to deliver", which is a pretty lame excuse, since this
hasn't really
been a valid way of distributing software for over a decade.
joe

On Sat, 4 Feb 2006 08:11:20 -0800, "Kalish" <kalish@xxxxxxx> wrote:

I have an exe which I want to "include" inside my mfc application as a
resource or whatever other way transparently to the user. The most
important
thing is that the mfc application won't need in the run-time, to look
for
the other exe. It will run this exe before it will do some other things
and
this will be transparent to the user(I hope I explained my need good
enough).

Is it possible and how?

Thanks in advance

Kalish

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm









.



Relevant Pages

  • Re: Proper use of #getImageBlock in runtime [LONG!]
    ... When Dolphin reads an icon or bitmap, ... It can load it from a "resource" embedded in an executable file ... where the FileLocator is an instance of one of the subclasses of FileLocator ... We can define a PackageRelativeFileLocator which includes the name of a package ...
    (comp.lang.smalltalk.dolphin)
  • UpdateResource Failure
    ... I would like to modify icon resoures in a exe file. ... I load the icon file to a byte array and then i pass it to the ... After that, I look into the exe file with the resource hacker, and the icon ...
    (microsoft.public.vb.winapi)
  • HLA v2.x and / or LASM suggestion: Win32 Resources
    ... With Microsoft's RC compiler, I've just noticed that it's less capable ... binary resource converted into readable, ... possible to create an icon or bitmap on-the-fly in the actual program ... make a separate tool and then all of them can share ...
    (alt.lang.asm)
  • Re: Icon not shown?
    ... the icon shows ok at the development ... Sounds to me the resource is ... >>somehow not built into the executable. ... > You can check your idea by loading the EXE file into ...
    (microsoft.public.vc.language)
  • Re: Single use of ICON in all forms
    ... > "Icon", but the Icon class does not have a FromStreammethod. ... > "Matt Berther" wrote in message ... >> Embedding the file as a resource is no big deal... ... Embedding it as a resource would still leave me with two ...
    (microsoft.public.dotnet.framework.windowsforms)