How to close a process

Carlos Vega García carlosvegagc at gmail.com
Mon Mar 19 05:25:02 CDT 2018


Hi!

I’m doing a test for the explorer.exe. The first part tests if the explorer Windows open. 
For that I´m using the function CreateProcessA(), the problem is that I can’t close the explorer that I have created.

This is what I have try and it haven’t worked. Any idea of how could I do it?

testExplorer = CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
	if (testExplorer != NULL) {

		/*WaitForSingleObject(testExplorer, 3000); */

		/*
		CloseHandle(testExplorer);
		*/

		/*
		CloseHandle(pi.hThread);
		CloseHandle(pi.hProcess);
		*/

		/*
		GetExitCodeProcess(testExplorer,lpExitCode);
		ExitProcess(lpExitCode);
		*/

		/*
		GetExitCodeThread(testExplorer,lpExitCode);
		TerminateProcess(testExplorer,lpExitCode);
		*/
		
		trace("\n \n Error: %u \n \n", GetLastError());

		return TRUE;
	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20180319/d1fa8ff0/attachment-0001.html>


More information about the wine-devel mailing list