diff --git a/py/LunaTranslator/myutils/hwnd.py b/py/LunaTranslator/myutils/hwnd.py index e293d042..70f6bf8f 100644 --- a/py/LunaTranslator/myutils/hwnd.py +++ b/py/LunaTranslator/myutils/hwnd.py @@ -116,8 +116,8 @@ def getpidexe(pid): ) if not hproc: - hproc = windows.OpenProcess( - windows.PROCESS_QUERY_LIMITED_INFORMATION, False, pid + hproc = windows.AutoHandle( + windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, False, pid) ) if not hproc: name_ = None