在Delphi中怎样执行一个外部应用程序,如执行一个 .bat 文件?
解决方案 »
- TPerlRegEx 一个工程正常,另一个出现DDC L4077 错误。怎么解决
- embeddedweb获取cookie后,如果使得从该组件打开的新页面也能获取到cookie。。。。谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 关于Query执行存储过程的问题。
- 菜鸟求救
- 为什么我Delphi6上所用Toolbar的Hint,和设计界面上的控件的Hint都不见了
- 取前50名记录怎么取
- 如何使程序在系统启动时自动运行
- 怎样改变stringgrid边框的颜色和某一栏的背景色??(在线)
- 急:Croba做三层结构不能使ado
- query使用procedure
- 目前要做一个 财务软件,很多地方不懂,请教一下
- 报表问题
UINT uCmdShow // window style for new application
);
ParameterslpCmdLinePoints to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, Windows searches for the executable file in this sequence: 1. The directory from which the application loaded.
2. The current directory.
3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
5. The directories listed in the PATH environment variable. uCmdShowSpecifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function. For a non-Windows - based application, the PIF file, if any, for the application determines the window state. Return ValuesIf the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values: Value Meaning
0 The system is out of memory or resources.
ERROR_BAD_FORMAT The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ResWin32-based applications should use the CreateProcess function rather than this function. The WinExec function exists in Win32 to provide compatibility with earlier versions of Windows. For more information about how the WinExec function is implemented, see the Res section of the LoadModule function.
In Win32, the WinExec function returns when the started process calls the GetMessage function or a time-out limit is reached. To avoid waiting for the time out delay, call the GetMessage function as soon as possible in any process started by a call to WinExec.
ShellExecute(Handle,'open',PChar('c:\123.bat'),nil,nil,SW_SHOW);
....
ShellExecute(Application.Handle,PChar('open'),PChar('c:\route1.bat'),nil,nil,SW_NORMAL);
.....
winexec不要再用了