Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hidden MessageBox
Message
 
To
22/07/1997 15:20:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00041174
Message ID:
00041206
Views:
117
>I have a recurring problem as follows:
>
>I have a modeless form (FORM1) that calls a modal form (FORM2) via a command button. Within the modal form (FORM2), the user presses a button that necessitates a yes-no question to be answered. So I use a MESSAGEBOX to ask the question. The problem: most of the time, the MESSAGEBOX appears "underneath" the modal form (FORM2) and is, therefore, invisible to the user. If I Hide() FORM2 before calling the MessageBox, it shows up perfectly.
>
>What, apparently, is happening is that the MessageBox "attaches" itself to the modeless form (FORM1), displaying itself on top of it. However, since the modal form (FORM2) takes up the entire screen, the MessageBox is invisible. If I press the key, the MessageBox jumps to the top--no idea why. BUT if the user doesn't know to press the key, the program looks as if it is hung up--there is a MessageBox waiting for an answer, but the user cannot respond since s/he can't see the damned thing! I have tried disabling both forms--no good.
>
>Any ideas out there??? TIA . . . .
>
>John

The VFP MESSAGEBOX() function is really nothing more than a hook into the Windows API function by the same name. While it's not documented in the VFP help file, you can control the modality level of MESSAGEBOX().

Try adding 4096 and/or 8192 to the values you're passing to the function. 4096 corresponds to MB_SYSTEMMODAL, 8192 to MB_TASKMODAL. Default state is MB_APPMODAL (0).

HTH,

George
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform