Esempio n. 1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if (HotKeyRegister.Register(this.Handle, (int)Keys.OemQuestion) == false)
     {
         Console.WriteLine("Error to register hotkey.");
     }
 }
Esempio n. 2
0
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);

            if (HotKeyRegister.IsHotkeyMessage(m.Msg))
            {
                if (HotKeyRegister.IsHotkeyId((int)m.WParam))
                {
                    ShowForm();
                }
            }
        }
Esempio n. 3
0
 private void InitHotKey()
 {
     for (int i = 0; i < this.Name.Length; i++)
     {
         hotchar = (uint)this.Name.ToUpper()[i];
         if (hotchar == ' ')
         {
             hotchar = 0; continue;
         }
         bool b = HotKeyRegister.GetHotKeyRegister().RegisterHotKey(Util.ModifierKeys.MOD_WIN, (Keys)hotchar, this);
         if (b)
         {
             break;
         }
     }
     if (hotchar != 0)
     {
         labelDescription.Text = labelDescription.Text + " ( Shortcut Win+" + (char)hotchar + " )";
     }
     else
     {
         labelDescription.Text = labelDescription.Text + " ( No Shortcut registered. )";
     }
 }
Esempio n. 4
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     HotKeyRegister.Unregister(this.Handle);
 }