hmmm danke schonmal für die funktion die gibt etwas zurück aber ob ich damit was machen kann weiss ich auch nicht hehe
hier mal mein code und der vb6 code hoffe ist nicht zuviel ;)
mein code :
Private Const RT_STRING As Integer = 6&
Private Const LOAD_LIBRARY_AS_DATAFILE = &H2
Private Const LOCALE_SENGLANGUAGE As Long = &H1001
Const SYSTEM_DEFAULT As Long = &H800
Private Declare Function GetUserDefaultLangID Lib "kernel32.dll" () As Short
Private Declare Function GetLocaleInfo Lib "kernel32" _
Alias "GetLocaleInfoA" ( _
ByVal Locale As Integer, _
ByVal LCType As Integer, _
ByVal lpLCData As String, _
ByVal cchData As Integer) As Integer
Private Declare Function LoadLibraryEx Lib "kernel32.dll" Alias _
"LoadLibraryExA" (ByVal lpLibFileName As String, ByVal hFile As Integer, _
ByVal dwFlags As Integer) As IntPtr
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As _
IntPtr) As Integer
Private Declare Function FindResourceEx Lib "kernel32" Alias _
"FindResourceExA" (ByVal hModule As IntPtr, ByVal lpType As Integer, ByVal _
lpName As Integer, ByVal wLanguage As Integer) As IntPtr
Private Declare Function LoadResource Lib "kernel32" (ByVal hInstance As _
IntPtr, ByVal hResInfo As IntPtr) As IntPtr
Private Declare Function LockResource Lib "kernel32" (ByVal hResData As _
IntPtr) As IntPtr
Private Declare Function SizeofResource Lib "kernel32" (ByVal hInstance As _
IntPtr, ByVal hResInfo As IntPtr) As Integer
Function LoadString(ByVal [LIB] As String, ByVal StringID As Integer) As String
Dim hLib As IntPtr = LoadLibraryEx([LIB], 0, LOAD_LIBRARY_AS_DATAFILE)
If Not hLib.ToInt32 = 0 Then
Dim resinfo As IntPtr = FindResourceEx(hLib, RT_STRING, (StringID \ _
16) + 1, MAKELANGID(7,1))
If Not resinfo.ToInt32 = 0 Then
Dim hRES As IntPtr = LoadResource(hLib, resinfo)
If Not hRES.ToInt32 = 0 Then
Dim hResPTR As IntPtr = LockResource(hRES)
If Not hResPTR.ToInt32 = 0 Then
Dim reslen As Integer = SizeofResource(hLib, resinfo)
Try
'MsgBox("Resourcelength: " & reslen)
'MsgBox(Marshal.PtrToStringAuto(hResPTR, reslen))
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End If
End If
FreeLibrary(hLib)
End If
End Function
Private Function MAKELANGID(ByVal p As Short, ByVal s As Short) As Integer
Return (s * 1024) Or p
End Functionim nexten post der vb6 code |