Solution
If you want to change the Windows language programatically, you will need to use Win32 API (User32.dll).
- Select the language identifier that you want to change using the function LoadKeyboardLayoutA
HKL LoadKeyboardLayoutA(
LPCSTR pwszKLID,
UINT Flags
);
where pwszKLID is the language identifier to be loaded and Flags specifies how the input locale identifier is loaded. You will need to set Flags as KLF_ACTIVATE (0x00000001) in order load and activate the input locale identifier for the system.
- Call the function ActivateKeyboardLayout in order to set the input locale identifier for the calling thread or the current process.
HKL ActivateKeyboardLayout(
HKL hkl,
UINT Flags
);
where hkl and Flags comes from the previous step.