Solved

MessageBox centered on Window after resize

Posted on 2007-11-26
3
469 Views
Last Modified: 2013-12-03
hi,

i have a dialogbased software. The dialog will be resied from time to time. But if I throw a messagebox the messagebox is not centered to the resized window rect, it is centered to the original (dialog init) rect. How I can change this that the messagebox comes centered of my resized dialog. Actual it looks like that the messagebox do not come from my software. :(

Ingo
0
Comment
Question by:Ocrana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:Thejaka
ID: 20355373
If the MessageBox looks like it's not from your app, try passing the owner (HWND) to the message box function.

I can't see how the MessageBox could come to be centered to the original rect, unless purely by chance... You show the message box after resizing is complete, right?
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 20355410
If you want full control of your MessageBox, you can use your own:
http://www.codeproject.com/dialog/CPPMessageBox.asp
http://www.codeproject.com/dialog/xmessagebox.asp
0
 

Author Comment

by:Ocrana
ID: 20358715
Finaly my question seems to be wrong. The problem do not occour on the resized dialog, it was only a "look & feel) thing. THe problem itself is, that the messagebox is thrown while a thread is running. In the thread I throw the messagebox with the HWND of the dialog that starts the thread.
But it use allways the HWND of the desktop and not of my software. Outside the thread it use the HWND of my dialog but only from the thread it seems it overwrite allways the HWND of the dialog with the one of the Desktop.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question