0

I've got a VBScript that calls a Visual FoxPro Instance and runs a VFP program. Part of this program produces a messagebox. However, if my script is run from the Windows GUI (rather than a Command Prompt), then the message box produced doesn't necessarily come to the foreground.

In VBScript I have the following code:

Set oVFP = CreateObject("VisualFoxPro.Application")
oVFP.DoCmd("Messagebox('Hello World')")
Set oVFP = Nothing

When I run this script from a DOS prompt, the message box pops to the foreground. When I double-click on the script in Explorer, the Explorer window may be covering the produced messagebox. There is no indication (no extra buttons on Start bar, for example) that the messagebox is hiding back behind the Explorer window waiting for user action.

Is there a way to force the produced messagebox to the foreground?

4

1 回答 1

3

将未记录的“系统模式”标志添加到 MessageBox 选项:

Set oVFP = CreateObject("VisualFoxPro.Application")
oVFP.DoCmd("Messagebox('Hello World', 4096)")
Set oVFP = Nothing
于 2009-04-09T10:10:09.357 回答