First I open web browser using shellexecute
command.
then How we can get close event of browser using MFC/VC++/C++?
Asked
Active
Viewed 271 times
0

Vijay Kumbhani
- 734
- 1
- 6
- 26
-
monitor browser process is ok? or WaitForSingleObject() – Jerry YY Rain May 30 '14 at 09:38
1 Answers
0
To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
And a quick lookup on stackoverflow gives this question, whose answer I quote here:
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);