473,663 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get icon from application exe

I want to get the icon from my application exe file

dim myIcon as Icon = ... -> "myApplication. exe,0"

how can I do that?
Nov 20 '05 #1
16 7758
Cor
Hi Dominique,

I never tested it have to do that still but I thought this was where you
where looking for?

Herfried will surely confirm when he does his round.

:-)

\\\By Herfried K Wagner
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAs sembly().GetMan ifestResourceSt ream( _
"WindowsApplica tion1.Ball.ico" _
) _
)
///

Cor

Nov 20 '05 #2
Cor,

* "Cor" <no*@non.com> scripsit:
I never tested it have to do that still but I thought this was where you
where looking for?

Herfried will surely confirm when he does his round.


I am not sure if this will solve the problem, but it will work for
embedded icon ressources.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
* "Dominique Vandensteen" <domi.vds_inser t@tralala_tenfo rce.com> scripsit:
I want to get the icon from my application exe file

dim myIcon as Icon = ... -> "myApplication. exe,0"

how can I do that?


AFAIS p/invoke on 'ExtractIconEx' if the icon is embedded as Win32
resource.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
used that one, it works

thx
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** *****@ID-208219.news.uni-berlin.de...
* "Dominique Vandensteen" <domi.vds_inser t@tralala_tenfo rce.com> scripsit:
I want to get the icon from my application exe file

dim myIcon as Icon = ... -> "myApplication. exe,0"

how can I do that?


AFAIS p/invoke on 'ExtractIconEx' if the icon is embedded as Win32
resource.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
Addendum:
Herfried will surely confirm when he does his round.


I am not sure if this will solve the problem, but it will work for
embedded icon ressources.


It won't work because the application icon is embedded as Win32
resource and .NET cannot deal with Win32 resources.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Cor
Hi Herfried,

Can you give me that routine dominique is using, I will try it also.

But finding out that wheel that you have 10000 times done, you know I will
distribute it only with your name.
Cor
Nov 20 '05 #7
Corm

* "Cor" <no*@non.com> scripsit:
Can you give me that routine dominique is using, I will try it also.

But finding out that wheel that you have 10000 times done, you know I will
distribute it only with your name.


I don't have written a routine using 'ExtractIconEx' , but you may find
working samples here:

<http://www.google.ch/groups?q=dotnet +ExtractIconEx>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
it works here...
code:

Public Declare Function DestroyIcon Lib "User32.dll " (ByRef phicon As
IntPtr) As Boolean
Public Declare Function ExtractIconEx Lib "shell32.dl l" _
(ByVal lpszFile As String, ByVal nIconIndex As Integer, _
ByRef phiconLarge As IntPtr, ByRef phiconSmall As IntPtr, ByVal nIcons As
Integer) _
As IntPtr
....
Dim iconPtr As IntPtr
Dim myIcon As Icon
ExtractIconEx(A pplication.Exec utablePath, 0, iconPtr, Nothing, 1)
-> returnvalue is number of icons found, so normally check for > 0 :-)
myIcon = Icon.FromHandle (iconPtr)
....
when "finished using" the icon:
DestroyIcon(ico nPtr)
dominique
"Cor" <no*@non.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi Herfried,

Can you give me that routine dominique is using, I will try it also.

But finding out that wheel that you have 10000 times done, you know I will
distribute it only with your name.
Cor

Nov 20 '05 #9
Cor
Hi Dominique,

Thanks

2 questions,
written by yourself (because I add that when I redistribute that)
combobox problem Net 1.0 or Net 1.1
Cor
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2215
by: Matthew Fitzpatrick | last post by:
when multiple similar forms are opened up, windows xp can group them into an application group button on the start bar. Unfortunately, this application group uses the icon of the application's executable, and not the icon that has been specified by form. another usenet post here (watch for URL wrap) ...
3
3417
by: Sam | last post by:
I've been googling for a couple of hours now and tried some different things, but I've been unable to get the icon for a distributed access application to do anything but display the default microsoft access icon. I've included the icon with the distribution and specified it as the application in the icon in the wizard, but no love from Access. Any help with this will me much appreciated. Thanks, Sam90
2
4693
by: shagshag | last post by:
I know how to place a notify icon in the system tray and how to hide the Form that owe the icon. The taskbar entry button is hidden, ok, but I always get an entry for the Form when I press "Alt+TAB". See my pb ?
2
9439
by: Vic | last post by:
I am trying to change an icon associated with my application's main form and the application itself. 1. I selected my main form in IDE "Solution" tab and went to "Properties" window. 2. I found "Icon" property, browsed for and selected a new icon. 3. I noticed the icon changed on my form 4. Ran my application and sure thing, the new icon replaced the default .NET icon.
3
8152
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my forms? once retrieved can I just set the form Icon? or do I need to do something special? Thanks Wayne
8
2275
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
1
8293
by: Brahm | last post by:
Hello, I have an application with a main class subclassing the System.Windows.Form and i changed the Icon setting for the application to point to a different icon file. Now, when my application runs, the icon appearing in the upper left hand side of the window frame is the default one and not the one i selected. I went back and checked after compilation and the properties for the form indicate the new icon name i designated but the...
2
2641
by: Randall Powell | last post by:
I am in the process of developing a Windows Service which will: (1) monitor multiple network shares; (2) marshal text file transfers into an SQL Server 2000 instance; and (3) provide messaging services via email and a customized event log viewer. An additional goal is to have the service provide a visual status indicator via an icon to be located in the Taskbar status area. The NotifyIcon component appears to be a logical candidate and worked...
4
6547
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks completely different. I overwrote the old ico file with the new ico file and re-ran the program. I still see the old logo at run-time. I right-clicked the project-> Add Existing Item-> added the new ico file. I set the build action to Embedded...
6
1560
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I have an application that places a notifier icon in the start tray. When the application closes, the icon appears to stay, till I place my mouse over it and then it will disappear. Can someone point in the direction of code to dispose of the notifier icon when the application closes? Michael
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.