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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message Box Position

Status
Not open for further replies.

tas2826

Programmer
Jul 6, 2005
26
US
I have a scenario where the size and position of a warning dialog is inconsistent depending on what is done with a modeless dialog that produces it. I have a modeless dialog that has a combo box that fires a kill focus event. If I tab out of the combo box the warning pops as expected centered over the parent modeless dialog centered both horizontally and vertically.

If I highlight the combo box, then click and drag the modeless dialog by its caption bar the kill focus fires as expected. However, the popup warning is now half the size and off to the left of the modeless dialog that produced it. It appears to be centered on the Windows desktop instead of my application dialog.

I have tried it as MessageBox, AfxMessageBox, and as a custom dialog we use for warnings and errors (Just a MessageBox with some custom bells and whistles). All produce the same weird positioning behavior.

Is this a quirk with MFC or Windows?

Is there any way for me to obtain a handle to a pop up dialog, such as AfxMessageBox and position it myself?

Is there some simple reason/solution I am just not seeing?

The app is written in VC++ 6. This is just an annoyance and does not effect the functionality of the app, it is just bugging me, help.

Thanks,

Troy
 
are you passing the HWND of the modeless box as the owner of the messagebox?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top