Jump to content

Search the Community

Showing results for tags 'Keyboard Layout'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello everyone, I can't get _WinAPI_SetKeyboardLayout to change the keyboard layout for autoit GUI windows (works fine for other windows), but I can get the current keyboard layout _WinAPI_GetKeyboardLayout .. am I missing something? $GUI = GUICreate('test') GUICtrlCreateEdit('', 10, 10) GUISetState() Sleep(1000) $KB = _WinAPI_SetKeyboardLayout("00000401", $GUI) Sleep(1000) MsgBox(0, $KB, _WinAPI_GetKeyboardLayout($GUI)) 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 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
×
×
  • Create New...