def _get_aimp_exe_path(self):
"""Find the AIMP executable path given its window handler.
:raises RuntimeError: The AIMP executable path cannot be found.
:rtype: None
"""
win_thread_proc_id = win32process.GetWindowThreadProcessId(self._aimp_window)
pwnd = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, win_thread_proc_id[1])
self._aimp_exe_path = win32process.GetModuleFileNameEx(pwnd, None)
if not self._aimp_exe_path:
raise RuntimeError('Unable to retrieve the AIMP executable.')
评论列表
文章目录