revert to VB and update to new project file format

This commit is contained in:
schedpas
2020-09-25 09:04:15 +02:00
parent 04869b2814
commit 9feaf658be
313 changed files with 9895 additions and 17566 deletions

View File

@@ -0,0 +1,31 @@
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports Pilz.Win32.Native
Namespace Internals
Public Class IconExtractor
''' <summary>
''' Extrahiert das Icon aus einer Datei oder aus einem Ordner.
''' </summary>
''' <param name="FilePath">Hier übergeben Sie den Pfad der Datei von dem das Icon extrahiert werden soll.</param>
''' <param name="Small">Bei übergabe von true wird ein kleines und bei false ein großes Icon zurück gegeben.</param>
Public Shared Function ExtractIcon(FilePath As String, Small As Boolean) As Icon
Dim icon As Icon
Dim shinfo As New SHFILEINFO
LibShell32.SHGetFileInfo(FilePath, 0, shinfo, Math.Truncate(Marshal.SizeOf(shinfo)), SHFILEINFO.SHGFI_ICON Or If(Small, SHFILEINFO.SHGFI_SMALLICON, SHFILEINFO.SHGFI_LARGEICON))
Try
icon = Icon.FromHandle(shinfo.hIcon)
Catch ex As Exception
icon = Nothing
End Try
Return icon
End Function
End Class
End Namespace