您的位置:首页 > 其它

调用外部程序并等待其运行结束/实例为调用QQ截图

2010-06-05 12:58 591 查看
var
SHExecInfo: SHELLEXECUTEINFO;
begin
//截图前隐藏主程序窗口
Form1.Hide;
//等待截图执行完成
SHExecInfo.cbSize := sizeof(SHELLEXECUTEINFO);
SHExecInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
SHExecInfo.Wnd := Handle;
SHExecInfo.lpVerb := 'open';
SHExecInfo.lpFile := 'Rundll32.exe';
SHExecInfo.lpParameters := 'CameraDll.dll,CameraSubArea';
SHExecInfo.lpDirectory := 'CameraDll.dll';
SHExecInfo.nShow := SW_SHOW;
SHExecInfo.hInstApp := Handle;
ShellExecuteEx(@SHExecInfo);
WaitForSingleObject(SHExecInfo.hProcess, INFINITE);
CloseHandle(SHExecInfo.hProcess);

//截图完成后显示主程序窗口
Form1.Show;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: