提个不好的思路
用findwindow来判断窗体是不是还存在
用截获消息的方法来判断用户是点了确定,还是取消

解决方案 »

  1.   

    用线程同步,用互赤对象,再用WaitForSingleObject函数
      

  2.   

    qiandeng(千灯) 感谢您的建议!谢谢!geliang(回来的光芒) ,我想请问以下您能否具体一点呢?我可能不太清楚您说的!谢谢! 
      

  3.   

    function RunProcessAndWait(const sCmdLine, sRunningDir: string; wShowWindow: WORD): Boolean;
    var
      nRetWait: Integer;
      stInfo: STARTUPINFO;
      prInfo: PROCESS_INFORMATION;
    begin
      ZeroMemory(@stInfo, SizeOf(stInfo));
      stInfo.cb := SizeOf(stInfo);
      stInfo.dwFlags := STARTF_USESHOWWINDOW;
      stInfo.wShowWindow := wShowWindow;  Result := CreateProcess(nil,
                               PChar(sCmdLine),
                               nil,
                               nil,
                               TRUE,
                               CREATE_NEW_CONSOLE
                               or NORMAL_PRIORITY_CLASS,
                               nil,
                               PChar(sRunningDir),
                               stInfo,
                               prInfo);  if Result then
      begin
        nRetWait :=  WaitForSingleObject(prInfo.hProcess, INFINITE);
        CloseHandle(prInfo.hThread);
        CloseHandle(prInfo.hProcess);
        Result := not (nRetWait = WAIT_TIMEOUT);
      end;
    end;
      

  4.   

    就象hellion(恶人)的代码这样 
    关健就是这句WaitForSingleObject(prInfo.hProcess, INFINITE);让它一直处于发信号状态,
    至于细节方面,你还是自己看书,看帮助吧,网上讲不清楚