.NET: IMessageFilter in Modal/Modeless dialog

Hello, i am trying to have WindowsForm opened in parallel with Bricscad - so user can access any of them (modeless dialog), but i have problem with using IMessageFilter.

First, i have found another post, which is kind of similar. They say that Application.PreTranslateMessage event should be used, but i was unable to find it...

Second, i did some tests, and discovered that IMessageFilter works in Modal dialogs, but not in Modeless.

  • System.Windows.Forms.Form.Show() and Bricscad.ApplicationServices.Application.ShowModelessDialog() doesn't fire IMessageFilter.PreFilterMessage
  • System.Windows.Forms.Form.ShowDialog() and Bricscad.ApplicationServices.Application.ShowModelessDialog() fires normally PreFilterMessage

I would appreciate if someone can explain why this is the case, or at least to point me where can i read more about this problem.
There should be single MessageLoop in the application, more are possible but not recommended, so if Bricscad has one message loop why PreFilterMessage doesn't work?

Sorry for long post, and thanks for help :smile:

PS. I also noticed that breakpoints for events in WindowsForms for modeless dialogs work normally, but for Modal dialogs i get "No source available".

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!