How to retreive the status of the child process?

Y

yyii

Hi,

I have a problem on retreiving the status of the child process. I want to
open IE and load local file. Just after it is loaded, I need to delete that
local file. It seems that I can't use the function
WaitForInputIdle/WaitForSingleObject in this situation. Please advise how I
can be notified once the IE is completed reading the file. Many thanks!

STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);

// Start the child process.
if( !CreateProcess( strBrowser, // No module name (use command line).
"random.html", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
// ErrorExit( "CreateProcess failed." );
}

// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE ); // it would only be
notified when the IE is killed.
//WaitForInputIdle(pi.hProcess, INFINITE);
DeleteFile(random.html);
 
J

John Harrison

yyii said:
Hi,

I have a problem on retreiving the status of the child process. I want to
open IE and load local file. Just after it is loaded, I need to delete that
local file. It seems that I can't use the function
WaitForInputIdle/WaitForSingleObject in this situation. Please advise how I
can be notified once the IE is completed reading the file. Many thanks!

You need a group for Windows programming, this group is about the C++
language, and there is no C++ language issue in your post. Try
for instance, and try learning some
netiquette before posting again.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top