public Form1() { InitializeComponent(); // set a filter for 5 seconds m_filter = new InactivityFilter(5000); m_filter.InactivityElapsed += new MethodInvoker(m_filter_InactivityElapsed); Application2.AddMessageFilter(m_filter); }
public Keytest3AKsdfForm() { InitializeComponent(); initListView(); _hwnd = new List <IntPtr>(); _hwnd.Add(this.Handle); _hwnd.Add(this.listView1.Handle); Application2.AddMessageFilter(this); win32.AllKeys(true); }
public Keytest3AKwm61() { InitializeComponent(); //prepare listview initListView(); Application2.AddMessageFilter(this); win32.AllKeys(true); this.KeyPreview = true; _hwnd = new List <IntPtr>(); _hwnd.Add(this.Handle); _hwnd.Add(listView1.Handle); }
public void AddMessageFilterTest() { AutoResetEvent filterEvent = new AutoResetEvent(false); TestFilter filter = new TestFilter(filterEvent); Application2.AddMessageFilter(filter); Form f = new Form(); f.Visible = true; Application2.DoEvents(); Assert.IsTrue(filterEvent.WaitOne(1000, false), "Filter PreFilterMessage was not called"); filterEvent.Close(); f.Dispose(); Application2.Exit(); }
private void mnuIMessageFilter_Click(object sender, EventArgs e) { mnuIMessageFilter.Checked = !mnuIMessageFilter.Checked; if (mnuIMessageFilter.Checked) { if (!_bMessageFilterActive) { Application2.AddMessageFilter(this); _bMessageFilterActive = true; } } else { if (_bMessageFilterActive) { Application2.RemoveMessageFilter(this); _bMessageFilterActive = false; } } }
public static void Main() { Application2.AddMessageFilter(mudFilter); Application2.Run(new MainForm()); }