/// <summary> /// This message adds or removes a <see cref="FlashMessageFilter"/> /// to or from the applications message pump to ensure the duplication /// of events captured by the activeX are notified also by the parent form. /// </summary> /// <param name="sendFlashMessagesToParent"><strong>True</strong>, /// if message filter should be added, <strong>false</strong>, /// if it should be removed.</param> public void SendMessagesToParent(bool sendFlashMessagesToParent) { // This message filter ensures the notification of // key and mouse events that the flash object receives // for recording if (sendFlashMessagesToParent) { this.messageFilter = new FlashMessageFilter(this.WebBrowser, this.WebBrowser.Parent); Application.AddMessageFilter(this.messageFilter); } else if (this.messageFilter != null) { Application.RemoveMessageFilter(this.messageFilter); this.messageFilter = null; } }
/// <summary> /// This method removes the current <see cref="FlashMessageFilter"/> /// from the message loop. /// </summary> private void RemoveMessageFilter() { if (this.messageFilter != null) { Application.RemoveMessageFilter(this.messageFilter); this.messageFilter = null; } if (this.messageFilterForMouseLeaveEvents != null) { Application.RemoveMessageFilter(this.messageFilterForMouseLeaveEvents); this.messageFilterForMouseLeaveEvents = null; } }