Link to home
Start Free TrialLog in
Avatar of kertkert
kertkert

asked on

Icons and VB.net

Don't know if it is even possible.

I have an application written in VB.Net. I want to change its executable icon at runtime, from that same application. It doesn't matter if the application needs a restart.
If someone could help me change some other exe's icon through VB.net, it would help me a lot.

Thanks in advance.
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

You'd probably have to resort to the Win32 imports to do this, however there are some issues that you'll encounter:
Retrieving an icon from an executable is (relatively) easy, saving it back to the executable isn't something I'm familiar with.
You'll need to manipulate the main executable from a 2nd executable as the main executable will be locked while it's running.

To get yourself started you'll have to use something like ExtractIcon from shell32.dll
http://msdn.microsoft.com/en-us/library/ms646973(VS.85).aspx
Avatar of kertkert
kertkert

ASKER

I just found out that somebody has asked a question pretty much like mine.
https://www.experts-exchange.com/questions/24294859/Changing-Icon-of-External-EXE-in-Vb-net.html
I still haven't managed to make some progress with this, so i'll do some rephrasing:
I need to change an icon (resource) of another executable within vb.net. Possible?
ASKER CERTIFIED SOLUTION
Avatar of kertkert
kertkert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial