易截截图软件、单文件、免安装、纯绿色、仅160KB

delphi执行外部程序等待程序运行成功,而不是程序退出

我想用delphi执行一个外部程序,等外部程序完全运行(这个程序不能关闭),并取得这个外部程序中的Edit句柄
在主程序运行的时候需要外部程序辅助,我现在用CreateProcess运行程序以后,因为程序太快edit句柄有时取不到,如何等待,这个外部程序完全打开了,再往下读句柄
function WinExecAndWait32(FileName: string; Visibility: integer): Dword;
      {执行一个外部程序并等待其结束}
var
  zAppName: array[0..512] of char;
  zCurDir: array[0..255] of char;
  WorkDir: string;
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
begin
  chmForm.btSaveas.Tag := 1;
  chmForm.btView.Tag := 1;
  TRY
    StrPCopy(zAppName, FileName);
    GetDir(0, WorkDir);
    StrPCopy(zCurDir, WorkDir);
    FillChar(StartupInfo, Sizeof(StartupInfo), #0);
    StartupInfo.cb := Sizeof(StartupInfo);
    StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
    StartupInfo.wShowWindow := Visibility;
    if not CreateProcess(nil,
      zAppName, { pointer to command line string }
      nil, { pointer to process security attributes }
      nil, { pointer to thread security attributes }
      false, { handle inheritance flag }
      CREATE_NEW_CONSOLE


相关问答:

ACCESS的自定义函数在delphi里怎么用呢...

我在模块里自定义了一个函数:stradd()

可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...

这个问题有什么办法可以解决的吗? 非常感激!


(在A ......

VC++ 中的&符号 对应的是Delphi中的哪个符号??

VC++ 中, &变量名。 是什么意思。 Delphi中 和他一样的符号 是哪个、?

大家都认为,C语言之所以强大,以及其自由性,很大部分体现在其灵活的指针运用上。因此,说指针是C语言的灵魂,一点都不为过。同时, ......

Delphi怎么取返回内容中的指定部分.

返回的内容是如下代码,怎么能渠道2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......

VC Delphi 内存速度比较 - VC/MFC / 非技术类

VC 控制台程序:
#include <iostream>
using namespace std;
int main()
{
const int def_buffer = 1024 * 4;
DWORD t;
BYTE b[def_buffer];
memset(b, 0, sizeof(b));
PBYTE p;
t = GetTickC ......

求一段delphi代码转C#代码,急用,可人民币支付,谢谢

急用。联系QQ:8775262,谢谢。
需要进行DllImport的地方直接写DLLImport.方法名。
如:DLLImport.GlobalAddAtom(……);
文件:UShare.pas
Delphi(Pascal) code:

unit UShare;
interface
uses Windows, Me ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号