// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
_T("explorer.exe"), // 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.
)
//wait a gracefully time
//so the window is created and is ready to answer messages.
::WaitForInputIdle(pi.hProcess,1000);
//m_hExplorerProcess=(DWORD)pi.hProcess;
//oops, this won't work
//if another explorer.exe instance exists
//the new process quits before EnumWindows
//::EnumWindows(EnumWindowsProc,(LPARAM)this);
// Close process and thread handles.