Witam, potrzebuję pomocy z funkcją Terminateprocess() w Winapi.
Otwieram zewnętrzny program w taki sposób:
if( !CreateProcess( NULL, // No module name (use command line)
szCmdline, // 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
)
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return 1;
}
I teraz chciałbym go zakończyć. Wiem, że potrzebuję uchwytu do procesu, ale w Winapi to mnie przerasta. :)
Jak takie coś wykonać?