MessageBox location

  • Thread starter Thread starter kelvin.koogan
  • Start date Start date
K

kelvin.koogan

I am having difficulty persuading MessageBoxes to appear over my
application (using C++/CLI in VS2005). I would expect

MessageBox::Show(this, "Some message");

to cause the message box to appear over the Form pointed to by this,
but it doesn't seem to work, it appears centered on the screen.

Any idea what I might be doing wrong?

TIA,
KK
 
I am having difficulty persuading MessageBoxes to appear over my
application (using C++/CLI in VS2005). I would expect

MessageBox::Show(this, "Some message");

to cause the message box to appear over the Form pointed to by this,
but it doesn't seem to work, it appears centered on the screen.

Any idea what I might be doing wrong?

TIA,
KK


I've tested in XP and Vista with both VS 2005 and VS 2008. I get the same
behavior. It could be a long running bug, or something we don't understand
about the Show method. Hopefully, somebody else will jump in here and open
our eyes :)
 
PvdG42 said:
I've tested in XP and Vista with both VS 2005 and VS 2008. I get the
same behavior. It could be a long running bug, or something we don't
understand about the Show method. Hopefully, somebody else will jump in
here and open our eyes :)

PvdG42:

This is standard Windows behavior. In MFC, AfxMessageBox() achieves
centering on the parent by using a Windows hook.

I'm sure there is some way to do this in .NET, but I don't know what it is.
 
David Wilkinson said:
This is standard Windows behavior. In MFC, AfxMessageBox() achieves
centering on the parent by using a Windows hook.

I'm sure there is some way to do this in .NET, but I don't know what it
is.


I feel better. At least I'm not the only one who doesn't know how to do it
:)
Thanks, David.
 
no- said:
PvdG42:

This is standard Windows behavior. In MFC, AfxMessageBox() achieves
centering on the parent by using a Windows hook.

I'm sure there is some way to do this in .NET, but I don't know what it is.
You do it the way you just said, you use a windows hook.

If it's any help, I have code I can post that uses a windows hook to
place arbitrary text on the buttons of a message box.

++PLS
 
Back
Top