protected override void WndProc(ref Message m)
        {
            var hotkeyInfo = HotkeyInfo.GetFromMessage(m);

            if (hotkeyInfo != null)
            {
                HotkeyProc(hotkeyInfo);
            }
            base.WndProc(ref m);
        }
Exemple #2
0
        protected override void WndProc(ref Message m)
        {
            var hotkeyInfo = HotkeyInfo.GetFromMessage(m);

            Debug.WriteLine((WindowsUtilities.WindowsMessages)m.Msg);
            Debug.WriteLine(hotkeyInfo);
            if (hotkeyInfo != null)
            {
                var keypair = hotkeyTable.Where(x => x.Key == hotkeyInfo).FirstOrDefault();
                keypair.Value(null, null);
            }
            base.WndProc(ref m);
        }
Exemple #3
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == Win32.WM_HOTKEY_MSG_ID)
            {
                Console.WriteLine(m.ToString());
            }
            var hotkeyInfo = HotkeyInfo.GetFromMessage(m);

            if (hotkeyInfo != null)
            {
                HotkeyProc(hotkeyInfo);
            }
            base.WndProc(ref m);
        }
Exemple #4
0
        /// <summary>
        /// Catches Windows' message about pressed hotkey
        /// and fires up the HandleHotkey method
        /// </summary>
        /// <param name="m"></param>
        protected override void WndProc(ref Message m)
        {
            // we check if the message is about out hotkey
            var hotkeyInfo = HotkeyInfo.GetFromMessage(m);

            if (hotkeyInfo != null)
            {
                string command = null;
                foreach (GlobalHotkey gh in this.ghList)
                {
                    if (gh.Key.Equals((int)hotkeyInfo.Key))
                    {
                        command = gh.command;
                    }
                }
                this.HandleHotkey(hotkeyInfo, command);
            }

            base.WndProc(ref m);
        }
        /*
         * private void KeybindingPrompt_KeyPress(object sender, KeyPressEventArgs e)
         * {
         *  Console.WriteLine("A KEY WAS PRESSED!!!!! :   "+ e.KeyChar+ " string: "+ e.ToString() );
         *  //this.Dispose();
         * }*/

        protected override void WndProc(ref Message m)
        {
            Console.WriteLine("something happened!");
            if (m.Msg == 0x101)
            {
                m.LParam = (IntPtr)((int)m.WParam * (int)Math.Pow(16, 4));
                Console.WriteLine(m.WParam);
                Console.WriteLine(m.LParam);
                m.Msg = Win32.WM_HOTKEY_MSG_ID;
            }
            var hotkeyInfo = HotkeyInfo.GetFromMessage(m);

            if (m.Msg == 0x101 || m.Msg == Win32.WM_HOTKEY_MSG_ID)
            {
                Console.WriteLine(m.ToString());
                Console.WriteLine("Detected!");
            }
            if (hotkeyInfo != null)
            {
                HotkeyProc(hotkeyInfo);
            }
            base.WndProc(ref m);
        }