示例#1
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 /// <param name="handle">target window handle</param>
 /// <param name="callBack">function pointer for the message recieved event</param>
 /// <param name="messageRecieved">filter to customize(filter) the message recieve event</param>
 public SubClassingWindow(IntPtr handle, MessageRecievedEventHandler messageRecieved, WndMessage[] filter)
 {
     Filter = new WndMessage[0];
     AssignHandle(handle);
     MessageRecieved = messageRecieved;
     Filter = filter;
 }
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 /// <param name="handle">target window handle</param>
 /// <param name="callBack">function pointer for the message recieved event</param>
 /// <param name="messageRecieved">filter to customize(filter) the message recieve event</param>
 public SubClassingWindow(IntPtr handle, MessageRecievedEventHandler messageRecieved, WndMessage[] filter)
 {
     Filter = new WndMessage[0];
     AssignHandle(handle);
     MessageRecieved = messageRecieved;
     Filter          = filter;
 }
示例#3
0
        public RecieveBuffer(MessageRecievedEventHandler mreh)
        {

            lenght = 0;
            recieved = 0;
            recievedBytes = new List<byte>();
            recievedMessage = false;
            MessageRecieved += mreh;
        }
示例#4
0
 public void Message(MessageType messageType, string message, params object[] args)
 {
     if (MessageRecievedEventHandler != null)
     {
         MessageReceivedEvent messageReceivedEvent = null;
         foreach (Delegate invocation in MessageRecievedEventHandler.GetInvocationList())
         {
             try
             {
                 messageReceivedEvent = (MessageReceivedEvent)invocation;
                 messageReceivedEvent(string.Format("{0}: {1}", messageType, string.Format(message, args)));
             }
             catch
             {
                 MessageRecievedEventHandler -= messageReceivedEvent;
             }
         }
     }
 }