private void OnSend(Ddeml.MONMSGSTRUCT mon)
        {
            var m = new Message {HWnd = mon.hwndTo, Msg = mon.wMsg, LParam = mon.lParam, WParam = mon.wParam};

            var args = new DdemlMessageActivityEventArgs(DdemlMessageActivityKind.Send, m, mon.hTask);

            MessageActivity?.Invoke(this, args);
        }
Пример #2
0
                private void OnSend(Ddeml.MONMSGSTRUCT mon)
                    {
                        var m = new Message();
                        m.HWnd = mon.hwndTo;
                        m.Msg = mon.wMsg;
                        m.LParam = mon.lParam;
                        m.WParam = mon.wParam;

                        var args = new DdemlMessageActivityEventArgs(DdemlMessageActivityKind.Send, m, mon.hTask);

                        if (MessageActivity != null)
                            MessageActivity(this, args);
                    }
Пример #3
0
        private void OnPost(Ddeml.MONMSGSTRUCT mon)
        {
            Message m = new Message();
            m.HWnd = mon.hwndTo;
            m.Msg = mon.wMsg;
            m.LParam = mon.lParam;
            m.WParam = mon.wParam;

            DdemlMessageActivityEventArgs args = new DdemlMessageActivityEventArgs(DdemlMessageActivityKind.Post, m, mon.hTask);

            if (MessageActivity != null)
            {
                MessageActivity(this, args);
            }
        }
Пример #4
0
 public bool PreFilterTransaction(DdemlTransaction t)
 {
     if (t.uType == Ddeml.XTYP_MONITOR) 
     {
         switch (t.dwData2.ToInt32())
         {
             case Ddeml.MF_CALLBACKS:
             {
                 // Get the MONCBSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONCBSTRUCT mon = (Ddeml.MONCBSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONCBSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnCallback(mon);
                 break;
             }
             case Ddeml.MF_CONV:
             {
                 // Get the MONCONVSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONCONVSTRUCT mon = (Ddeml.MONCONVSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONCONVSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnConversation(mon);
                 break;
             }
             case Ddeml.MF_ERRORS:
             {
                 // Get the MONERRSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONERRSTRUCT mon = (Ddeml.MONERRSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONERRSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnError(mon);
                 break;
             }
             case Ddeml.MF_HSZ_INFO:
             {
                 // Get the MONHSZSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONHSZSTRUCT mon = (Ddeml.MONHSZSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONHSZSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnString(mon);
                 break;
             }
             case Ddeml.MF_LINKS:
             {
                 // Get the MONLINKSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONLINKSTRUCT mon = (Ddeml.MONLINKSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONLINKSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnLink(mon);
                 break;
             }
             case Ddeml.MF_POSTMSGS:
             {
                 // Get the MONMSGSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONMSGSTRUCT mon = (Ddeml.MONMSGSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONMSGSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnPost(mon);
                 break;
             }
             case Ddeml.MF_SENDMSGS:
             {
                 // Get the MONMSGSTRUCT object.
                 int length = 0;
                 IntPtr phData = Ddeml.DdeAccessData(t.hData, ref length);
                 Ddeml.MONMSGSTRUCT mon = (Ddeml.MONMSGSTRUCT)Marshal.PtrToStructure(phData, typeof(Ddeml.MONMSGSTRUCT));
                 Ddeml.DdeUnaccessData(t.hData);
                 _Parent.OnSend(mon);
                 break;
             }
         }
     }			
     return true;
 }