The information in this article applies to:
SYMPTOMS
Using ::MessageBox in an application built with the Software Development
Kit (SDK) with a NULL owner window and MB_TASKMODAL disables all top-level
windows belonging to a task, as if it were a modal dialog box.
CAUSE
The problem is due to "enable on activate" code in CFrameWnd that activates
a window when it is clicked, even if it was disabled. This works around the
Windows bug where clicking on the owner of a modal dialog box doesn't
activate the dialog box instead.
The most recently called function is at the top of the list.
RESOLUTION
To work around this problem, use CWnd::MessageBox or AfxMessageBox instead
of ::MessageBox. If you must use ::MessageBox, specify a window as the
owner rather than using NULL as the first parameter. For example, to
specify the application's main window as the owner, use this code:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: 2.00 2.10 3.00 3.10 4.00 4.10 MessageBox Modeless
Keywords : kbcode kbnokeyword kbMFC kbVC |
Last Reviewed: July 28, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |