title: Return process id
body: <p>I have this issue that I want to resolve. Lets think we have this situation. We have one instance of notepad.exe running. I run another notepad.exe. Now I want to kill the latter. How can I do it?</p>
  
  <p>If I was able to know the pid of last notepad.exe then I could kill it. But how to get the PID of last opened program?</p>
  
  <p>Another way is to give every application a unique image name. From what I learned it seems impossible becouse image names are hard coded into the binary file.</p>
  
  <p>So any ideas?</p>
  
  <p>P.S. As you already noticed this is all in windows.</p>