这也是一个调用外部EXE文件的指令,他是ANSI C的程序,很老的.他system ()与LaunchExecutableEx()不同在前一个程序的运行不影响调用程序的运行,而后一个需要调用程序等待被调用程序执行完后,再继续.
---------------------------------------------------------
Starts running a program and waits for it to exit.
If you do not want to wait for the program to exit,
use the LaunchExecutable() function in the Utility Library.
The executable can be either an MS DOS or MS Windows executable, including *.exe, *.com, *.bat and *.pif
files. The function does not return until the command
terminates, and user keyboard and mouse events are ignored
until the command exits. Callbacks for asynchronous events,
such as idle events, Windows messages, and VXI interrupts, PostDeferred calls, and DAQ events are called while the command is executing.
If you need to execute a command built into command.com such as
copy, dir, etc, you can call LaunchExectuable() with the command:
"command.com /C DosCommand args",
where DosCommand is the shell command you want to be executed.
Refer to your DOS documentation for further help with command.com.
.exe, .com, and .bat DOS programs use the settings in _default.pif (in your Windows directory) when running. You can
change their priority, display options, etc by editing
_default.pif or by creating another pif file. Refer to your
Microsoft Windows documentation for help on creating and editing pif files.
/*-------------------- Prototype ---------------------*/
int system (const char Command[]);
----------------------------------------------------------------------
Performs the same operation as LaunchExecutable with the following extended features:
Under Windows, you can specify how the Windows application displays.
LaunchExecutableEx returns a handle to the executable that can show whether the executable is still running and also can terminate the executable.
Note If you want to wait for the program to exit, use the system function in the ANSI C Library.
When you launch several processes with LaunchExecutableEx but do not call RetireExecutableHandle on them, you might reach the limit for the maximum number of processes the system imposes. This happens even if the processes terminate; the program does not recognize that the processes have terminated until you call RetireExecutableHandle.
Prototype
int LaunchExecutableEx (char Filename[], int Window_State, int *Handle); |