0

hi, i am making a program that kills a process

system("taskkill /im explorer.exe");

and i need to restart the process using CreateProcess.

CreateProcess(NULL,("C:\\WINDOWS\\explorer.exe"), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &siStartupInfo, &piProcessInfo);

but i keep getting these errors: 27 `siStartupInfo' undeclared (first use this function) and 27 `piProcessInfo' undeclared (first use this function)

any solutions?

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by thecoolman5
0

Did you declare siStartupInfo and piProcessInfo?
If so, where in the program did you delcare them?

0
STARTUPINFO siStartupInfo = {0};
siStartupInfo.cb = sizeof sif;
siStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
siStartupInfo.wShowWindow = SW_NORMAL;
PROCESS_INFORMATION piProcessInfo = {0};

And an alternate method is recommended by using ShellExecute/ShellExecuted if you don't want to manipulate the new process.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.