By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,824 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,824 IT Pros & Developers. It's quick & easy.

How to retreive the status of the child process?

P: n/a
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);
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"yyii" <yy**@mail.hongkong.com> wrote in message
news:bi**********@news.ctimail.com...
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
news:comp.os.ms-windows.programmer.win32 for instance, and try learning some
netiquette before posting again.

john
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.