I want to get the icon from my application exe file
dim myIcon as Icon = ... -> "myApplication. exe,0"
how can I do that? 16 7758
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
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>
* "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>
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>
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>
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
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>
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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)
...
|
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
|
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 ?
|
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.
|
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
| |
by: Adrian |
last post by:
How do I put an icon on a form using code?
Thank you.
|
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...
|
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...
|
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...
|
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
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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...
|
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();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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...
| |