我想在一个程序里调用另一个程序,怎么办??
看以前的帖子。说用WinExecute。
我在DELPHI的帮助里没找到。
看以前的帖子。说用WinExecute。
我在DELPHI的帮助里没找到。
解决方案 »
- delphi中如何才能使用http传输exe文件呢???
- 问高手,关于WebBrowser控件使用的高级问题 (Cookie)
- 关于检测对方IE的问题。
- 我们的软件工程老师艾尼瓦尔给出以下问题:------好难的!!
- 关于资源文件res的菜鸟问题~~~在线等待~~~尚未结贴~~~~~~~~
- 如何一个存储过程配多个cxgrid?
- 三层系统,数据库的广域网上(电信托管),用什么方式实现比较好?
- 请问如何在dxdbgrid中显示数据库中的JPG图片?
- 怎么改变菜单栏TMainMeun的颜色?
- 谁可以告诉我SDK的概念,请各位大虾赐教!
- 计划展望期,时区,时段,时界,需求时界,计划时界等时间名词看了ERP方面的书,但是还是不明白这些意思啊,还有MPS的计算公式具体要考虑
- 紧急求救!如何改写DbGrid中一列的内容.
在DELPHI的帮助中的“windows SDK”里面有的啊
我的是D6.
The WinExec function runs the specified application. This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function. UINT WinExec( LPCSTR lpCmdLine, // address of command line
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.
WinExec(LPCSTR lpCmdLine,Uint uCmdshow);
参数如下:
lpCmdline:命令执行字符串,出就是我们在“开始”——“执行”或是在DOS窗口下,可以输入的命令行,能过这个命令行,可以传入不同的执行命令,而执行时顺注意下列事项
1,此应用程序必须可以执行
2,目录及路径必须正确
3,自己可以调用自己
4,被调用的程序为独立的执行绪,和调用者无关
5,不可远程调用
uCmdShow: 执行模式,程序执行时所显示的状态,我们可以让程序在执行时无声无息,出可发显示成最大窗口
SW_HIDE:将程序隐藏
SW_MAXIMIZE:将程序最大化
SW_MINIMIZE:将程序最小化
SW_RESTORE:将程序还原化
SW_SHOW:将程序显示在正确的位置
SW_SHOWDEFAULT:将程序显示在默认的位置
SW_SHOWMAXIMIZED:将程序显示最大化
SW_SHOWMINIMIZED:将程序显示最小化
SW_SHOWMINNOACTIVE:将程序显示最小化但不Active
SW_SHOWNA:将程序显示但Active
SW_SHOWNOACTIVEATE:将程序显示但不Active
SW_SHOWNORMAL:将程序显示一般状态
返回值大于31说明程序执行成功
上帝呀!
要是向你说的那样。我就完蛋了!
你快说清楚点!