/// <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; }
public RecieveBuffer(MessageRecievedEventHandler mreh) { lenght = 0; recieved = 0; recievedBytes = new List<byte>(); recievedMessage = false; MessageRecieved += mreh; }
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; } } } }