PROCEDURE SetKeyboard LPARAMETER lcKeyboardcode IF VARTYPE(lcKeyboardcode)<>'C' RETURN ENDIF IF EMPTY(lcKeyboardcode) RETURN ENDIF LOCAL pwSzklid pwSzklid = SPACE(8) DECLARE INTEGER GetKeyboardLayoutName IN user32.DLL STRING @ geTkeyboardlayoutname(@pwSzklid) DECLARE INTEGER ActivateKeyboardLayout IN user32.DLL INTEGER, INTEGER IF ATC(lcKeyboardcode, pwSzklid)=0 acTivatekeyboardlayout(1,0) ENDIF RETURN ENDPROCHow to use it
Set procedure to YourFunctionLibrary && Where the function is storedNow in GotFocus of your Arabic textbox call the above function like this
SetKeyboard('401')
To switch it back to English use it like this in the GotFocus of English textboxSetKeyboard('409')
If you want your application start with Arabic keyboard then you can use it to your main.prg.