呵呵,不懂,什么叫shellexecute运行???

解决方案 »

  1.   

    就是如何关闭由shellexecute运行起来程序。
      

  2.   

    可不可以获取由shellexecute运行的程序的句柄,通过该句柄来kill
      

  3.   

    ShellExecute doesn't return a window handle, nor does it return a process handle. You can't use anything 
    you get from ShellExecute to close that application.You should either use ShellExecuteEx with the NOCLOSEPROCESS flag, then you'll get a process handle. 
    With that handle you can call TerminateProcess (not clean, though).Another solution would be to start the process with CreateProcess. This API tells you both the process 
    handle and the processID. Having the processID you can enumerate the windows the belong to the newly 
    started process and then use "PostMessage(processMainWindow, WM_CLOSE, 0, 0)" to close it cleanly
      

  4.   

    急急急!用TerminateProcess均无法使之停止啊!!!
      

  5.   

    用CreateProcess打开进程,可得到句柄和ID,用TerminateProcess杀之。
      

  6.   

    杀不死!
        FillChar(execinfo,SizeOf(execinfo),0);
        execinfo.cbSize:=sizeof(execinfo);
        execinfo.lpVerb:='Open';
        execinfo.lpFile:=Pchar('ser_ckgl.exe'); //所要執行的外部程式 execinfo.lpParameters:=Pchar(param); file://參數
        execinfo.fMask:=SEE_MASK_NOCLOSEPROCESS;
        execinfo.nShow:=SW_SHOWDEFAULT;//顯示窗體類型
        GetExitCodeProcess(execinfo.hProcess,run_result);
        ShellExecuteEx(@execinfo);     //执行
       // if (not ShellExecuteEx(@execinfo)) then  showmessage('没找到系统所需的服务器端执行文件!');;
       // WaitForSingleObject(execinfo.hProcess,INFINITE); //會一止等待直到你所執行的外部程式結束,才會把控制權交給你的應用程式。
      //
       fn:='ser_comp.txt';
       FileHandle := FileCreate(fn);
       FileWrite(FileHandle,fn,1);
       FileClose(FileHandle);
       //
       TerminateProcess(execinfo.hProcess,run_result);
      

  7.   

    注意看了一下,你的代码好像有问题啊,还没有执行就GetExitCodeProcess了,你的句柄从哪儿来的啊,都还没有运行呢。你调整一下位置试试。
      

  8.   

    搞定了,对不起,上面的代码没错,是from.onclose做其它导致不能关闭,谢谢大家!!!
      

  9.   

    请教各位汉化高手:
        本人欲将一英文软件的安装界面汉化,其安装界面是用InstallShield制作,
    本人已将其中的三文件均已汉化,这三文件为Setup.exe,_Setup.dll,及
    _sys1.cab中的_IsRes.Dll。但还有一部分界面是英文,故又查看了所有文件的
    资源对话框(包括*.cab中的文件),也未能找到此界面,故推测它是用脚本语言
    进行了改变。若是这样那我应该在什么文件里用什么工具去修改它。
      

  10.   

    to DDY
    我以前也有做过安装汉化,在INSTALLSHIEL里新建一个PROJECT 在选语言中选汉字,
    把相应的ENGLISH改成CHINESE就可以了。
      

  11.   

    你这人说话也不算数,别人帮你解答确只给一半的分。
    ___________________________________________________________回复人: sundayboys(sunboy) (2001-8-18 15:47:28)  得10分 
    ShellExecute doesn't return a window handle, nor does it return a process handle. You can't use anything 
    you get from ShellExecute to close that application.You should either use ShellExecuteEx with the NOCLOSEPROCESS flag, then you'll get a process handle. 
    With that handle you can call TerminateProcess (not clean, though).Another solution would be to start the process with CreateProcess. This API tells you both the process 
    handle and the processID. Having the processID you can enumerate the windows the belong to the newly 
    started process and then use "PostMessage(processMainWindow, WM_CLOSE, 0, 0)" to close it cleanly