首先,我使用 shellexecute
命令打开网络浏览器。
那么我们如何使用MFC / VC ++ / C ++获取浏览器的近似事件?
答案 0 :(得分:0)
获取有关作为a启动的应用程序的信息 调用ShellExecute的结果,使用ShellExecuteEx。
快速查找stackoverflow会给this question,我在这里引用它的答案:
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);