delphikeyboard-shortcutsdelphi-2009keyboard-layout

How can I simulate Alt+Shift to change the language in Windows (II part)?


The problem (switching language dynamically) is solved with ActivateKeyboardLayout, but it still remains when i dynamically create a component on the form ( for ex. TEdit ). When this component gets into focus, the language changes to default. I tried use again ActivateKeyboardLayout, after creating the components, but it did not worked. Any ideas ?


Solution

  • at first you have to use "Windows" then you can use this method: ActivateKeyboardLayout(EnglishLayoutHandle, KLF_ACTIVATE) you can change "EnglishLayoutHandle" for any lang you want