
Signature
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
Hi Wayne,
When MessageBox.Show is called without passing an IWin32Window, it will call
UnsafeNativeMethods.GetActiveWindow which returns a handle to the active
window for the message loop that belongs to that thread.
If your application isn't active, then GetActiveWindow will return null -
this is why your form is selectable even though a messagebox is being
displayed. It's definitely not a bug in the framework, and the fix you've
suggested is exactly what you should be doing.
Hope this helps.
Regards,
Matt Garven
> I posted this in microsoft.public.dotnet.languages.csharp with name of "Bug
> in Framework?"
[quoted text clipped - 11 lines]
> I know calling MessageBox.Show(this, "TEST") will make it work just fine,
> but shouldn't the method work the same in every case?
Wayne - 15 Feb 2005 13:07 GMT
I understand why it works the way it does, I just don't understand why it is
correct. I mean shouldn't the message box really look for the applications
currently active window? or modal each of the currently displayed windows?
I just question the way it is implemented due to the fact that it doesn't
operate the same in all scenarios and something like this should.
> Hi Wayne,
>
[quoted text clipped - 27 lines]
> > I know calling MessageBox.Show(this, "TEST") will make it work just fine,
> > but shouldn't the method work the same in every case?