/// <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> /// Raise the MessageRecieved event /// </summary> /// <param name="handle">target window handle</param> /// <param name="m">recivied message</param> private void RaiseMessageRecieved(IntPtr handle, WndMessage m) { if (null != MessageRecieved) { MessageRecieved(handle, m); } }
/// <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; }
protected void ChangeMessage(WndMessage msg) { if (msg != null) { _message = msg; InitControls(); } }
// Start is called before the first frame update void Awake() { wndMessage = this; txtMessage = transform.Find("txtMessage").GetComponent <Text>(); btnOK = transform.Find("btnOK").GetComponent <Button>(); rectWnd = GetComponent <RectTransform>(); Close(); }
protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc(ref m); WndMessage wndMessage = WndMessage.WM_NULL; if (null != Filter && Filter.Length != 0) { System.Enum.TryParse <WndMessage>(m.Msg.ToString(), out wndMessage); if (WndMessage.WM_NULL == wndMessage) { return; } if (FilterMode == MessageFilterMode.WhiteList) { foreach (var item in Filter) { if (wndMessage == item) { RaiseMessageRecieved(Handle, wndMessage); return; } } } else { bool found = false; foreach (var item in Filter) { if (wndMessage == item) { found = true; break; } } if (true == found) { RaiseMessageRecieved(Handle, wndMessage); } } } }
private void LogMessage(IntPtr handle, WndMessage message) { string recievedMessage = message.ToString(); textBox1.Text = recievedMessage + Environment.NewLine + textBox1.Text; }
private void LogMessage(IntPtr handle, WndMessage message) { string recievedMessage = message.ToString(); textBox1.Text = recievedMessage + Environment.NewLine + textBox1.Text; }
/// <summary> /// Raise the MessageRecieved event /// </summary> /// <param name="handle">target window handle</param> /// <param name="m">recivied message</param> private void RaiseMessageRecieved(IntPtr handle, WndMessage m) { if (null != MessageRecieved) MessageRecieved(handle, m); }
/// <summary> /// Creates an instance of the class /// </summary> /// <param name="handle">target window handle</param> public SubClassingWindow(IntPtr handle) { Filter = new WndMessage[0]; AssignHandle(handle); }
/// <summary> /// Creates an instance of the class /// </summary> /// <param name="handle">target window handle</param> public SubClassingWindow(IntPtr handle) { Filter = new WndMessage[0]; AssignHandle(handle); }