Click to See Complete Forum and Search --> : how can I kill the application?


mase
September 13th, 2007, 03:28 PM
I use shellexecute function to launch application, but now I wish to kill it, what function can I use?

kirants
September 13th, 2007, 04:30 PM
Why do you want to kill it ? Perhaps there are ways to make it go away gracefully..

mase
September 13th, 2007, 07:37 PM
why do I want to kill it? I really don't have any reason. It's just for the learning process that I want to know some basic common task using window programming such launching application and closing it.

when I say closing it, I really to want to end its process so it won't show up in the task manager that it's running.

kirants
September 13th, 2007, 07:57 PM
check out topics on windows SDK FAQs forum here:
http://www.codeguru.com/forum/index.php?

mase
September 13th, 2007, 08:54 PM
that's alot of materials to read. It can be handy, thanks.

kirants
September 13th, 2007, 11:25 PM
You could start with the index and pick the ones most relevant to you ( Processes in your case ) and go from there ;)

Zaccheus
September 14th, 2007, 05:49 AM
Here's the actual FAQ you need:

"Processes: How can I kill a process?"
http://www.codeguru.com/forum/showthread.php?t=312449

mase
September 14th, 2007, 12:19 PM
I went to the FAQ and read about the process... It's kind of hard to understand :(

mase
September 14th, 2007, 07:25 PM
const TCHAR *text = TEXT("MyEvent");
int terminateMyAPP()
{
HANDLE terminate = CreateEvent(NULL, FALSE, FALSE, text );
if(!terminate)
return 0;

If(GetLastError()== ERROR_ALREADY_EXISTS)
{
SetEvent(terminate);
Sleep(8000);
CloseHandle(terminate);
}

return 0;

}