Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MessageBox centered on Window after resize

Posted on 2007-11-26
3
Medium Priority
?
481 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

660 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