I'm developing a Presentation software.
My application loops through the items of a playlist, get the Associated program for the item (=filename) to be showed, and then launches the associated program using "ShellExecute" function. So far so good...
But after specific time, the executed associated program needs to be properly closed (NOT terminated/killed). I'm able to get the processname (i.e. notepad.exe) and PID.
But I don't see a way to close the program using the Processname. I have found a way to Kill the program/process by using "TerminateProcess", but that is not the way I want to do it.
So my question is if there is a way to properly stop/close an external program by using the ProcessName or ProcessID.
Thanks in advance!!