title: Fast way to check for a specific process running
body: <p>To check a process is running, one can use the "CreateToolHelp32SnapShot" Windows API function and enumerate the running processes. Example C/C++ code is given in the answer question:
  <a href="https://stackoverflow.com/questions/13179410/check-whether-one-specific-process-is-running-on-windows-with-c">Check whether one specific process is running on windows with C++</a></p>
  
  <p>My question is whether there is a faster way to find the answer without having to check each process in turn if you know you're looking for a <strong>specific</strong> process? We need to regularly check that our remote support tool, TeamViewer.exe, is running. Note that TeamViewer is written by a 3rd party, we have no control over it or knowledge of the internals of the EXE.</p>
  
  <p>EDIT:</p>
  
  <p>TeamViewer have provided some information about the internals of their process which can be used to speed this up in this instance (see accepted answer). The answer also shows how to speed up this check for any process (by saving the process ID).</p>