Tech Support > Computers & Technology > Programming > HOWTO: display message box in MFC dialog app which has child window?
HOWTO: display message box in MFC dialog app which has child window?
Posted by Vladimir on December 13th, 2003


Hello,

I've written a simple dialog app which has a child window in it. But there
is one problem. When I try to create and show other dialogs (CColorDialog,
SHBrowseForFolder or my custom dialogs), this child window is always on the
top and I cannot see them. The only way is to press ALT key.

Is there any possible way to solve this weird problem? Maybe I should send
WM_SYSCHAR or some other message to notify main dialog window about ALT key
being pressed. NOTE that overriding OnInitDialog() and calling ShowWindow()
in it is not the right way because simple MessageBox() is also covered by
child window. Also I cannot hide this child window due to some reasons.

Regards,
Vladimir.




Posted by Niki Estner on December 13th, 2003


Don't cross-post to so many newsgroups. This is definitely no
"comp.programming" topic.

What window styles does your child window have? WS_POPUP? WS_OVERLAPPED?
Does it have WS_EX_TOPMOST style? Try chinging these.
Did you try changing the Z-Order with SetWindowPos?
Which window do you specify as a parent for your modal dialogs? The main
dialog or the child dialog? You probably should use the child window if it's
topmost.

Niki

"Vladimir" <_g_e_n_i_s_o_f_t_@inbox.ru> schrieb im Newsbeitrag
news:1071323696.137949@ufacom.ru...


Posted by Jussi Jumppanen on December 13th, 2003


Vladimir wrote:

Yes there is. Dialogs will always stay above their parent
window. So to fix this just create the dialogs, making
sure the parent handle used is the window handle of the
top most window, which in this case is a dialog.

Jussi Jumppanen
Author of: Zeus for Windows (All new version 3.92 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com


Similar Posts