1 //检查输入法的全角半角状态 2 public static void ChangeControlIState(IntPtr h) 3 { 4 IntPtr HIme = ImmGetContext(h); 5 if (ImmGetOpenStatus(HIme)) //如果输入法处于打开状态 6 { 7 int iMode = 0; 8 int iSentence = 0; 9 bool bSuccess = ImmGetConversionStatus(HIme, ref iMode, ref iSentence); //检索输入法信息 10 if (bSuccess) 11 { 12 if ((iMode & IME_CMODE_FULLSHAPE) > 0) //如果是全角 13 { 14 iMode &= (~IME_CMODE_FULLSHAPE); 15 ImmSimulateHotKey(h, IME_CHOTKEY_SHAPE_TOGGLE); //转换成半角 16 } 17 else 18 { 19 ImmSimulateHotKey(h, IME_CHOTKEY_SHAPE_TOGGLE); //转换成全角 20 } 21 } 22 } 23 }
第14行 iMode &= (~IME_CMODE_FULLSHAPE);
&= 是个什么东东?运算符么??