background image

if(direc[i] != ProcessName[i])

goto SetValue;

}

}

delete []direc;

return;

}

//创建 explorer 进程的函数,如果创建了一个虚拟桌面,那么最好调用该函数

void StartExplorer()

{

STARTUPINFO si;

ZeroMemory( &si, sizeof(si) );

si.cb = sizeof(si);

si.lpDesktop = "Virtual";

ZeroMemory( &piExplor, sizeof(piExplor) );

if( !CreateProcess( NULL, // No module name (use command line).

"explorer", // 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.

&piExplor ) // Pointer to PROCESS_INFORMATION structure.

)

{

MessageBox(NULL,"无法初始化 Explorer","Error",0);

ExitProcess(1);