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/>