delphi - TouchKeyboard component doesn't always adopt process language -


i use delphi ttouchkeyboard component typing on windows. keyboard switches between different layouts different languages on own. use different input languages in different processes. therefore check process language when focused , change keyboard layout if doesn't fit. works of languages, arabian language (and maybe others, too), layout won't adopt. keyboard shows layout (the 1 of process focused before), in destination process arabian letters typed. has explanation , can tell me how make keyboard language fit process language?

below procedure makes keyboard layout fit process layout:

procedure tform1.applytocurrentprocesslanguage; var layout: hkl; myhandle: thandle; begin   myhandle := getforegroundwindow;   layout := getkeyboardlayout(getwindowthreadprocessid(myhandle)) div 65536;   activatekeyboardlayout(layout, 0); end; 


Comments