ActivateKeyboardLayout 设置调用线程或当前进程为输入区域设置标识符;
System.Windows.Forms.InputLanguage.CurrentInputLanguage 获取或设置当前线程的输入语言
/// <summary> /// 设置调用线程或当前进程为输入区域设置标识符. /// </summary> /// <param name="HKL">被激活的输入区域设置标识符,值为键盘布局句柄或者是1或0</param> /// <param name="flags">指定要激活的输入区域设置标识符是如何被激活的</param> /// <returns>返回值的类型是HKL。如果函数成功,返回值是以前的输入区域设置标识符。否则,它是零</returns> [DllImport("user32")] public static extern int ActivateKeyboardLayout(int HKL, int flags);
相关链接
默认输入区域设置:https://msdn.microsoft.com/zh-cn/library/cc766503(v=ws.10)
ActivateKeyboardLayout:https://msdn.microsoft.com/zh-cn/library/windows/desktop/ms646289(v=vs.85).aspx
InputLanguage.CurrentInputLanguage:https://msdn.microsoft.com/zh-cn/library/system.windows.forms.inputlanguage.currentinputlanguage(v=vs.110).aspx
时间: 2024-10-07 21:34:17