How to Display a Task Modal Dialog from a 32-Bit DLLLast reviewed: October 29, 1995Article ID: Q129798 |
The information in this article applies to:
SUMMARYIf a Message box is displayed from a 32-bit DLL by calling it from Visual Basic version 4.0, the Message box does not behave as if it were a task modal dialog. In other words, Visual Basic allows you to change the focus to other forms in the application by clicking them. On the other hand, a MsgBox displayed from Visual Basic itself always behaves as if it were a task modal dialog. This article shows by example how to force a Message box invoked from a 32-bit DLL to behave as a Visual Basic MsgBox behaves.
MORE INFORMATIONAll Visual Basic applications have a background window that handles all messages for the application and all calls to the VB40032.DLL. This background window is also the owner and parent of all non-MDI child forms. You can use the GetWindow API function to get the handle of this background window, and subsequently pass this handle to the Message box called from the 32-bit DLL, so that it is also owned by the Visual Basic background window. NOTE: You can also make the Message box task-modal in the DLL itself by calling it with a hWndOwner (first parameter) of NULL and a fuStyle (last parameter) of MB_TASKMODAL.
Step-by-Step Example
|
Additional reference words: 4.00 vb4win vb432
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |