呵呵,不懂,什么叫shellexecute运行???
解决方案 »
- CRC16校验 请高手指教~~
- 关于cxGrid 的view 的oncellclick事件不能同showmessage方法
- delphi程序怎样屏蔽windows所有热键?如alt+tab,ctrl+alt+delte,显示桌面等所有热键
- 跳好,还是留好?
- 如何检测当前电脑的分辨率是多少?
- 我用WebBrowser控件写了个自动注册网页ID的程序,可是每次做完之后都是同一个账号,请问怎样可以每次申请的时候,都让WebBrowser控件刷新
- 求皮肤按钮的解决方案!像金山词霸的按钮一样!
- 紧急菜鸟问题:把QuickRep控件的page的orientation设为横向,为什么预览的时候还是纵向?
- 查询数据
- 你想回答就回答吧,问你个问题。
- Dll 的地址冲突问题!
- 如何删除一个DCOM服务?
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
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);
本人欲将一英文软件的安装界面汉化,其安装界面是用InstallShield制作,
本人已将其中的三文件均已汉化,这三文件为Setup.exe,_Setup.dll,及
_sys1.cab中的_IsRes.Dll。但还有一部分界面是英文,故又查看了所有文件的
资源对话框(包括*.cab中的文件),也未能找到此界面,故推测它是用脚本语言
进行了改变。若是这样那我应该在什么文件里用什么工具去修改它。
我以前也有做过安装汉化,在INSTALLSHIEL里新建一个PROJECT 在选语言中选汉字,
把相应的ENGLISH改成CHINESE就可以了。
___________________________________________________________回复人: 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