Letzte Kommentare

    Archive

    Kategorien

    Auflisten von Ressourcen in einer DLL

    Public Class ResourceEnumerator
    
        Shared _currentList As List(Of String)
    
        Public Shared Function GetHTMLFileName(dllPath As String) As String
            Dim handle = LoadLibrary(dllPath)
    
            _currentList = New List(Of String)
    
            If handle = IntPtr.Zero Then
                Throw New Win32Exception
            End If
            If Not EnumResourceTypes(handle, AddressOf EnumTypesCallback, IntPtr.Zero) Then
                Throw New Win32Exception
            End If
    
            Dim file = (From f In _currentList Where f.ToLower.EndsWith(".html")).FirstOrDefault
            Return file
        End Function
    
        Shared Function EnumTypesCallback(hModule As IntPtr, lpszType As IntPtr, lParam As IntPtr) As Boolean
            EnumResourceNames(hModule, lpszType, AddressOf EnumResourceCallback, IntPtr.Zero)
            Return True
        End Function
    
        Shared Function EnumResourceCallback(hModule As IntPtr, lpszType As IntPtr, ByVal lpszName As IntPtr, ByVal lParam As IntPtr) As Boolean
            Dim type As String = lpszType.ToInt32().ToString()
            If [Enum].GetValues(GetType(ResourceType)).Cast(Of Integer).Contains(lpszType.ToInt32()) Then
                type = [Enum].GetName(GetType(ResourceType), lpszType.ToInt32())
            ElseIf lpszType.ToInt32() > &HFFFF Then
                type = Marshal.PtrToStringUni(lpszType)
            End If
            Dim name As String = lpszName.ToInt32().ToString()
            If lpszName.ToInt32() > &HFFFF Then
                name = Marshal.PtrToStringUni(lpszName)
            End If
            'Console.WriteLine("Resource type={0}, id={1}", type, name)
            _currentList.Add(name)
            Return True
        End Function
    
    End Class
    
    Module GlobalFunctions
    
        Delegate Function EnumResNameProcDelegate(ByVal hModule As IntPtr, ByVal lpszType As IntPtr, ByVal lpszName As IntPtr, ByVal lParam As IntPtr) As Boolean
        Delegate Function EnumResTypeProc(hModule As IntPtr, lpszType As IntPtr, lParam As IntPtr) As Boolean
    
        <DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
        Public Function LoadLibrary(ByVal lpFileName As String) As IntPtr
        End Function
    
        <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, SetLastError:=True)>
        Public Function EnumResourceTypes(ByVal hModule As IntPtr, ByVal lpEnumFunc As EnumResTypeProc, ByVal lParam As IntPtr) As Boolean
        End Function
    
        <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, SetLastError:=True)>
        Public Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As IntPtr, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean
        End Function
    
        Public Enum ResourceType
            CURSOR = 1
            BITMAP = 2
            ICON = 3
            MENU = 4
            DIALOG = 5
            [STRING] = 6
            FONTDIR = 7
            FONT = 8
            ACCELERATOR = 9
            RCDATA = 10
            MESSAGETABLE = 11
            GROUP_CURSOR = 12
            GROUP_ICON = 14
            VERSION = 16
            DLGINCLUDE = 17
            PLUGPLAY = 19
            VXD = 20
            ANICURSOR = 21
            ANIICON = 22
            HTML = 23
            MANIFEST = 24
        End Enum
    
    End Module
    

    Setzen der IE-Version für WebBrowser-Control

    Private Enum BrowserRenderEngine
        IE7 = 7000
        IE9 = 9000
    End Enum
    Private Sub SetRenderingEngine(Value As BrowserRenderEngine)
        ' http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", IO.Path.GetFileName(Application.ExecutablePath), Value, Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", IO.Path.GetFileName(Application.ExecutablePath), Value, Microsoft.Win32.RegistryValueKind.DWord)
    End Sub
    

    Tools

    Paint.NET

    EQATEC Profiler

    LinqPad

    Synergy

    ReOrganize

    Wix#
    https://wixsharp.codeplex.com/
    Setups erzeugen per C#-Code

    RegexLab.NET
    https://regexlab.codeplex.com/

    Sizer
    http://www.brianapps.net/sizer/

    R
    https://cran.r-project.org/bin/windows/base/

    ScreenRecorder
    http://icecreamapps.com

    SuperCharger
    https://visualstudiogallery.msdn.microsoft.com/f58941e3-13c6-4e97-9235-195f6f380ea3

    Konvertierung von SPSS-SAV-Dateien nach Excel mithilfe von R

    install.packages("xlsx")
    install.packages("foreign")
    library("xlsx")
    library("foreign")
    
    db = file.choose()
    dataset = read.spss(db, to.data.frame=TRUE)
    write.xlsx2(dataset, "D:\\downloads\\converted.xlsx", sheetName="Sheet1", col.names=TRUE, row.names=TRUE, append=FALSE)