473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Icons importing from DLL or EXE

JR
Hi,

I want to import Icons from DLL or exe files into a imagelist. I ave no Idee
how to do it. I know the different icons have a 0 based index

Jan
Nov 21 '05 #1
4 1935
"JR" <XX***@XX.XX> schrieb:
I want to import Icons from DLL or exe files into a imagelist. I ave no
Idee how to do it. I know the different icons have a 0 based index


..NET Icon Explorer
<URL:http://vbaccelerator.com/article.asp?id=4567>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
JR
the program is very nice but the code is in C# I need something in in VB.net
thanks anyway
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:uv**************@TK2MSFTNGP15.phx.gbl...
"JR" <XX***@XX.XX> schrieb:
I want to import Icons from DLL or exe files into a imagelist. I ave no
Idee how to do it. I know the different icons have a 0 based index


.NET Icon Explorer
<URL:http://vbaccelerator.com/article.asp?id=4567>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"JR" <XX***@XX.XX> schrieb:
the program is very nice but the code is in C# I need something in in
VB.net


Either keep the code in a C# class library or translate it to VB.NET:

Converting code between .NET programming languages
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
JR
I have tryed but I have to many errors

i changed an old code from VB6

'Start code
Private Declare Function ExtractIconEx Lib "shell32.dll" Alias
"ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Integer,
ByVal phiconLarge As Integer, ByVal phiconSmall As Integer, ByVal nIcons As
Integer) As Integer

Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Integer, ByVal
X As Integer, ByVal Y As Integer, ByVal hIcon As Integer) As Integer

Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Integer)
As Integer
Function pfGetIconFromDLL(ByVal DLL As String, ByVal nIconNR As Integer) As
Image
Dim X, Y, Tot, Cnt As Integer
Dim mIcon As Integer
Dim img As New PictureBox
Dim sFileExtensie As String
Try
Dim fInfo As New FileInfo(DLL)
Select Case fInfo.Extension.ToLower
Case ".ico", ".bmp", ".jpg"
img.Image = Image.FromFile(DLL)
Case Else
ExtractIconEx(DLL, nIconNR, mIcon, 0%, 1%)
DrawIcon(img.Handle.ToInt64, 0%, 0%, mIcon)
img.Refresh()
DestroyIcon(mIcon)
End Select
Catch ex As Exception
MsgBox("Fout:" & ex.Message)
End Try
Return img.Image
End Function

But I cant' get it into a image
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:uj**************@TK2MSFTNGP15.phx.gbl...
"JR" <XX***@XX.XX> schrieb:
the program is very nice but the code is in C# I need something in in
VB.net


Either keep the code in a C# class library or translate it to VB.NET:

Converting code between .NET programming languages
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

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

Similar topics

5
by: drum118 | last post by:
Has anyone experience problems with firewall blocking some icons and not others. I am using Zone alarm and have the popup set for medium and it was blocking some of the icons for some strange...
24
by: Crom | last post by:
Ok. I want to settle this once and for all. After looking at the source for various, rather sizeable (but not all were so big) web sites that use icons that show up in the addressbar beside the...
3
by: sto | last post by:
look at this picture http://upload.cs99.net/e.gif i use the function SHGetFileInfo to get file icons. but these icons are not very nice. there are some black things round of the icons. many...
2
by: Jigar Mehta | last post by:
Hye, I am Jigar Mehta, I want to ask how can we put our own 48 X 48 - 32 bit icons in the interface like near password field, I want to put Password Icon. The icons are created with Alpha support...
6
by: B-Dog | last post by:
Does anyone know where I can find some professional looking icons that are the standard windows collection for developers? The ones that came on the VS cd are pretty lame. Thanks
17
by: Brett | last post by:
I'd like references on where to find some good (quality) icons to use for form and application icons (for the EXE). Most of the free stuff isn't that great looking and there isn't a good...
2
by: SharpCoderMP | last post by:
i'm trying to embed multiple program icons in my executable. the only way so far i managed to do that is to embed native win32 resource file with multiple icons. it works, but... when i create a...
3
by: Pucca | last post by:
HI, I'm using vs2005. There are very few icons I found in the folder of vs2005imagelibrary under the install folder of vs2005. Does anyone know where I can download icons that are typically used...
4
by: Sanoski | last post by:
This might be a dumb question. I don't know. I'm new to all this. How do you find icons for your programs? All GUI applications have cool icons that represent various things. For instance, to save...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.