[blue]Option Explicit
Private Declare Function SetThreadLocale Lib "kernel32" (ByVal Locale As Long) As Long
Private Declare Function GetThreadLocale Lib "kernel32" () As Long
Private Declare Function LoadString Lib "user32" Alias "LoadStringA" (ByVal hInstance As Long, ByVal wID As Long, ByVal lpBuffer As String, ByVal nBufferMax As Long) As Long
Private Sub Command1_Click()
Dim result As Long
result = GetThreadLocale ' save current thread locale
MsgBox vbLoadResString(101) ' Ok, display current locale string
SetThreadLocale (&H40C) 'Set locale of this thread to French (France) for this example
MsgBox vbLoadResString(101) ' Now display French language string
SetThreadLocale result ' Set locale back to original
MsgBox vbLoadResString(101) ' Display string for original locale
End Sub
' Warning this replacement for the LoadResString only work's in compiled programs
' because of the use of App.hInstance in the LoadString function
Public Function vbLoadResString(id As Long) As String
vbLoadResString = Space(256)
LoadString App.hInstance, id, vbLoadResString, Len(vbLoadResString)
End Function[/blue]