title: How to get Process name by Python?
body: <p>I want to get process name (ex:notepad.exe) by using win32 api in Python ,
  so the code like ,</p>
  
  <pre><code>hwnd = FindWindow(None,"123.txt - notepad")
  threadid ,pid = win32process.GetWindowThreadProcessId(hwnd)
  print('pid=' + str(pid))
  handle = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION | win32con.PROCESS_VM_READ, FALSE, pid)
  proc_name = win32process.GetModuleFileNameEx(handle, 0)
  </code></pre>
  
  <p>but the exception occur , </p>
  
  <pre><code>pywintypes.error: (299, 'GetModuleFileNameEx', 'ReadProcessMemory
  or WriteProcessMemory ....exception')
  </code></pre>
  
  <p>How can I solve this problem?</p>
  
  <p>Thanks.</p>