MessageFilter's

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I am using the OpenNETCF Application2 and MessageFilter classes and all seems
ok on the form that application2.run() is opening but when I hide it and show
a secondary form, the PreFilter() method never gets called for any events on
the second form.

How do I receive events from the other windows I may pop up in my application?

Thanks in advance!
 
First off thanks for your time Chris!

I am using Show().

I hide the main form because if you close it the app exits, then I open this
second form.

If the user clicks home screen it unhides the original form and closes the
secondary form.

I'm not sure it really fits as a dialog because I don't want both open at
the same time but one is required in the application.run to keep the app
alive as I understand it?

Thanks again!
Simon
 
Sorry my mistake, after further investigation the library I am using for
navigation is doing ShowDialog.

I cannot receive MessageFilters application wide with forms displayed with
ShowDialog()?

Thanks,
Simon
 
ShowDialog is problematic due to how it works. When you call ShowDialog,
the new dialog is spun up with its own message pump, and we have no way to
hook it, so we can't filter it's messages. If you're using a filter, take a
look at Application2.ShowDialog, which will give you dialog behavior that
also works with the filter.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
Back
Top