IntPtr process_id = GetWindowThreadProcessId(fore_ptr, out pid);
IntPtr layout = GetKeyboardLayout(process_id);
public static StringBuilder GetInput(IntPtr fore_ptr) {
IntPtr layout = GetKeyboardLayout(fore_ptr);
ActivateKeyboardLayout((int)layout, 0x100);
StringBuilder Input = new StringBuilder();
GetKeyboardLayoutName(Input);
return Input;
}
string lang_code = GetInput((IntPtr)0).ToString();