How to place MessageBox *always* in center of screen?
It's obvious that calls to AfxMessageBox() always center themselves in the window object from where they are called, but can I change this behavior so that my calls to AfxMessageBox() are always in the center of the screen?
I guess I could create my own modal dialog class with a new constructor that takes a string argument (the error message). Is this the only way?
Thanks.
Re: How to place MessageBox *always* in center of screen?
::MessageBox(NULL, "Error text", "Title", MB_ICONSTOP|MB_OK|MB_TASKMODAL );
The TASK_MODAL flag will disable all top-level windows, and hWnd=NULL will center the messgae box on the screeen (since it has no window).
Re: How to place MessageBox *always* in center of screen?
Try AfxMessageBox()
I believe it displays in the mid of the screen