Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center MessageBox() in Win32

Status
Not open for further replies.

dc2000

Programmer
Jun 7, 2005
48
US
Hi everyone:

I seem to be stumped by the simplest -- I have a Win32 program and I need to display a message box centered by the parent window. Here's the example:

Code:
MessageBox(hParentWnd, "Message to display", "Program Name", MB_ICONERROR | MB_OK);

Well, the problem is that it is centered in the middle of the screen and it's position has nothing to do with the parent window. I stepped through the entire AfxMessageBox() in MFC, which by the way places it's message box in the middle of a parent window, and found absolutely nothing.

Can someone tell me what am I doing wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top