Solved

MessageBox centered on Window after resize

Posted on 2007-11-26
3
458 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
3 Comments
 
LVL 8

Expert Comment

by:Thejaka
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bigDiff challenge 17 74
Change to event 1 72
Add values of each row in an array 3 29
FMX TCameraComponent Problem 2 9
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now