In dot net, the inputlanguage object is "Provide methods and fields to manage the input language. This class cannot be inherited ."
The installedinputlanguages method in the inputlanguage object obtains the input method installed by the system. The currentinputlanguage method obtains or sets the current input method. The defaultinputlanguage method obtains the default input method of the system. You can use the three methods of the inputlanguage object to set the specified input method.
HoweverProgramWhen it is used by others, an error is accidentally reported on one of the machines. Because the program has been compiled and is not with the author, I only know that there is a problem with the inputlanguage object, but the specific error number is unknown.
After remotely watching the error message via QQ, I felt that he did not install the Chinese input method. However, he clearly installed the input method, such as sogou and QQ pinyin. The input method is also normal.
Intuitively, view his "text service and input language" window. Normally, it should be like the following.
Unexpectedly, This is blank on his computer. The following message is displayed: "The incompatible keyboard driver is detected. This dialog box has been disabled ".
I searched for a solution on the Internet. For various reasons, the contents under the key value of HKEY_LOCAL_MACHINE \ systemcurrentcontrolset \ Control \ keyboard layouts in the system registry are all deleted.
For more information, see "blank text service and input language options ".
Follow the above method to import the missing registry to his system. OK! Solved. No error is reported.
It can be seen that the inputlanguage object controls the input method by accessing the registry. If the registry content is incorrect. This leads to errors.
However, it is hard to understand why a registry error occurs, but the input method can be used normally.