Не помню выкладывал или нет скрипт смены языка клавиатуры.
Возможно кому то будет полезен.
Работает в режиме тогла, т.е. переключает с языка на язык при старте.
Скрипт не мой нашел на просторах сети
PHP код:
#NoTrayIcon
Global $Rus = '00000419' ; Раскладка русского языка
Global $Eng = '00000409' ; Раскладка английского языка
$hWnd = WinGetHandle('', '')
If _WinAPI_GetKeyboardLayout($hWnd) = $Rus Then
_WinAPI_SetKeyboardLayout($Eng, $hWnd)
ElseIf _WinAPI_GetKeyboardLayout($hWnd) = $Eng Then
_WinAPI_SetKeyboardLayout($Rus, $hWnd)
EndIf
Func _WinAPI_GetKeyboardLayout($hWnd)
Local $Ret = DllCall('user32.dll', 'long', 'GetWindowThreadProcessId', 'hwnd', $hWnd, 'ptr', 0)
If (@error) Or ($Ret[0] = 0) Then
Return SetError(1, 0, 0)
EndIf
$Ret = DllCall('user32.dll', 'long', 'GetKeyboardLayout', 'long', $Ret[0])
If (@error) Or ($Ret[0] = 0) Then
Return SetError(1, 0, 0)
EndIf
Return '0000' & Hex($Ret[0], 4)
EndFunc ;==>_WinAPI_GetKeyboardLayout
Func _WinAPI_SetKeyboardLayout($sLayout, $hWnd)
If Not WinExists($hWnd) Then
Return SetError(1, 0, 0)
EndIf
Local $Ret = DllCall('user32.dll', 'long', 'LoadKeyboardLayout', 'str', StringFormat('%08s', StringStripWS($sLayout, 8)), 'int', 0)
If (@error) Or ($Ret[0] = 0) Then
Return SetError(1, 0, 0)
EndIf
DllCall('user32.dll', 'ptr', 'SendMessage', 'hwnd', $hWnd, 'int', 0x0050, 'int', 1, 'int', $Ret[0])
Return SetError(0, 0, 1)
EndFunc ;==>_WinAPI_SetKeyboardLayout