[API]
Public FreeLibrary

[DIRECTIVE]
LoadResEx_LanguageFile

[DEFINE]
Public LoadResEx_LanguageFile_hModul As Long

[INCLUDE]
LoadLibrary

[CODE]
Public Function LoadResEx_SetLanguageFile(Optional ByVal Filename As String, Optional ByVal IdentifyString As String) As Boolean
  If Not LoadResEx_LanguageFile_hModul = App.hInstance Then
    Call FreeLibrary(LoadResEx_LanguageFile_hModul)
    LoadResEx_LanguageFile_hModul = App.hInstance
    End If
  If Not Len(Filename) = 0& Then
    LoadResEx_LanguageFile_hModul = LoadLibrary(Filename)
    If LoadResEx_LanguageFile_hModul = 0& Then
      LoadResEx_LanguageFile_hModul = App.hInstance
      Else
      If Len(IdentifyString) = 0& Then
        LoadResEx_SetLanguageFile = True
        ElseIf LoadResEx_String(1&) = IdentifyString Then
        LoadResEx_SetLanguageFile = True
        Else
        FreeLibrary LoadResEx_LanguageFile_hModul
        LoadResEx_LanguageFile_hModul = App.hInstance
        End If
      LoadResEx_SetLanguageFile = True
      End If
    End If
  End Function