Форумы HiProg.com - MS ACCESS, VBA, VB

 

Ответить на сообщение

Вернуться к теме

Вы отвечаете на сообщение:

ник: Дядя Федор
Набор ф-й для раскладки


Public Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (pwszKLID As Any) As Long
  Public Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal HKL As String, ByVal Flags As Long) As Long
  
Dim bArr(500) As Byte
  Function decodeString() As String
      Dim i As Integer
      Dim SS As String, bb As Byte
      SS = ""
      For i = 1 To 500
          bb = bArr(i)
          If bb <> 0 Then
              SS = SS & Chr(bb)
          Else
              decodeString = SS
              Exit Function
          End If
      Next i
      decodeString = SS
      Exit Function
  End Function
  Public Function getCurrentLanguage()
      Dim z As Long
      z = GetKeyboardLayoutName(bArr(1))
      If z = 0 Then
          getCurrentLanguage = ""
      Else
          getCurrentLanguage = decodeString
      End If
  End Function
  Public Function getCurrentLanguage()
      Dim z As Long
      z = GetKeyboardLayoutName(bArr(1))
      If z = 0 Then
          getCurrentLanguage = ""
      Else
          getCurrentLanguage = decodeString
      End If
  End Function
 'Переключает на русский
  Public Function switchToRussian()
      Dim SS As String
      SS = getCurrentLanguage
      If InStr(SS, "419") = 0 Then
          LoadKeyboardLayout "00000419", 1
      End If
  End Function
  'Переключает на английский
  Public Function switchToEnglish()
      Dim SS As String
      SS = getCurrentLanguage
      If InStr(SS, "409") = 0 Then
          LoadKeyboardLayout "00000409", 1
      End If
  End Function


пс. На win7 не пробовал


Ваше имя:

Пароль:

Цитировать: [quote][/quote] Код: [code][/code]
Жирный: [b][/b] Наклонный: [i][/i]
URL: [url][/url] 

Сообщение:

 Размер файла не более 50 Кбт. Большие файлы можно размещать на www.slil.ru

Прикрепить:

 

Для вставки смайлов в текст щелкните по значку.