Esempio n. 1
0
 /// <summary>
 /// 注册快捷键
 /// </summary>
 /// <param name="mainIntPtr"></param>
 public static void RegistrationKey(IntPtr mainIntPtr)
 {
     if (Resources.dicThisInt != null)
     {
         foreach (var item in Resources.dicThisInt)
         {
             String[] stringKey = item.Value.HotKey.Split('+');
             SystemHotKey.KeyModifiers[] key = StringToKey(stringKey);
             SystemHotKey.RegisterHotKey(mainIntPtr, item.Key, (uint)key[0] | (uint)key[1], signKey(stringKey[2]));
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 确定关闭窗口
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != null)
     {
         bool sign = SystemHotKey.RegisterHotKey(MianIntPtr, Resources.MaxNum, (uint)Resources.keysOne | (uint)Resources.keysTwo, Resources.keySan);
         if (sign)
         {
             Resources.dicThis[LnkName].HotKey = textBox1.Text;    //对应程序名的  快捷键  修改
             Resources.dicThis[LnkName].id     = Resources.MaxNum; //对应程序名的  注册Id  修改
             Resources.MaxNum++;                                   //注册Id++
         }
         Resources.Transformation();
     }
     this.Close();
 }