private void Window_MsgProc(object sender, WndMsgEventArgs e)
 {
     if (DelegatesDict.ContainsKey(e.Msg))
     {
         DelegatesDict[e.Msg].Invoke(sender, new WndMsgCommEventArgs(e));
     }
 }
Exemple #2
0
        private IntPtr WndProcHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            var e = new WndMsgEventArgs(msg, wParam, lParam);

            OnWndMsgReceived(e);
            if (e.Handled)
            {
                handled = true;
            }
            return(IntPtr.Zero);
        }
Exemple #3
0
        protected void OnWndMsgReceived(WndMsgEventArgs e)
        {
            AllMsg?.Invoke(this, e);
            switch (e.Msg)
            {
            case WindowsMessages.HOTKEY:
                MsgHotkey?.Invoke(this, e);
                break;

            case WindowsMessages.CLIPBOARDUPDATE:
                MsgClipboardChanged?.Invoke(this, e);
                break;

            case WindowsMessages.POWERBROADCAST:
                MsgPowerBroadcast?.Invoke(this, new WndMsgPowerBroadcastEventArgs(e));
                break;
            }
        }
Exemple #4
0
 public WndMsgCommEventArgs(WndMsgEventArgs e)
     : base(e.Msg, e.wParam, e.lParam)
 {
 }
Exemple #5
0
 public WndMsgPowerBroadcastEventArgs(WndMsgEventArgs e)
     : base(e.Msg, e.wParam, e.lParam)
 {
 }