| Jan Bucek 2006-04-07, 7:43 am |
| vfpDev@hotmail.com napsal(a):
> How can I change the language of the keyboard from VFP?
>
> thanks
>
FUNCTION ActivateKeyboard(pcL
N)
* pcLN char code: LayoutName - see FoxPro.H (CZ: 05, ENG: 09 ...)
* returns .T. if O.K., .F. if requested LayoutName not installed
local xcLN, xcLangCode, xcOriginLC
pcLN=iif(empty(pcLN)
, [09], pcLN) && default ENG
DECLARE INTEGER GetKeyboardLayoutNam
e IN WIN32API STRING @
DECLARE INTEGER ActivateKeyboardLayo
ut IN WIN32API INTEGER, INTEGER
xcLN=SPACE(9)
GetKeyboardLayoutNam
e(@xcLN)
xcLangCode=substr(xc
LN, 7, 2)
xcOriginLC=xcLangCod
e
IF xcLangCode==pcLN && set, do nothing
RETURN .T.
ENDIF
ActivateKeyboardLayo
ut(0, 1) && set another LN
GetKeyboardLayoutNam
e(@xcLN)
xcLangCode=substr(xc
LN, 7, 2)
DO WHILE xcLangCode <> xcOriginLC
IF xcLangCode==pcLN && requested LN, end
RETURN .T.
ENDIF
ActivateKeyboardLayo
ut(0, 1) && set next LN
GetKeyboardLayoutNam
e(@xcLN)
xcLangCode=substr(xc
LN, 7, 2)
ENDDO
RETURN .F.
|