每次调用WinExec后,都是弹出另外一个窗口并打开应用程序。
请问可不可以这样:
将要调用的程序的运行窗口限制在调用它的表单之内?就好象是表单的一个控件似的?
请问可不可以这样:
将要调用的程序的运行窗口限制在调用它的表单之内?就好象是表单的一个控件似的?
解决方案 »
- 【集思广益】物业管理软件到底都需要什么功能?
- 又一年,突然生出许多感慨
- delphi初学者又来问菜鸟级的问题了,关于自己写的procedure,在哪里定义啊?
- 请介绍一下Cardinal这种类型?
- 关于delphi,请教高手
- 在Delphi6中调用DLL和Delphi5中不同啊!
- 请教数据库操作错误
- 急!!!!个人版的sql2000上开发的delphi数据库软件能在sql server 2000服务器上的通用吗?前两个每人20分!!!
- 很简单的问题!(点击DBGRID中的一个格子,弹出FORM,请问是在DBGRID中的哪个事件里)
- 高手帮忙呀(http://www.csdn.net/expert/topicview1.asp)
- 求职(北京)
- 怎样判断adoquery执行的sql是否成功?
function TFrmCustShot.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
Result := 0; { pointer to PROCESS_INF }
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; //sw_show
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 or { creation flags }
NORMAL_PRIORITY_CLASS,
nil, { pointer to new environment block }
nil, { pointer to current directory name }
StartupInfo, { pointer to STARTUPINFO }
ProcessInfo) then
begin
Application.MessageBox('无法启动要运行的软件',
'警告!',Mb_Ok or MB_ICONWARNING);
exit;
end
else
begin
WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess,Result);
end;
Result := 1; { pointer to PROCESS_INF }
end;