mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
fix
This commit is contained in:
parent
cdf7e5591d
commit
434d1f1fc9
@ -413,7 +413,11 @@ class texthook(basetext):
|
|||||||
return string
|
return string
|
||||||
|
|
||||||
def removeproc(self, pid):
|
def removeproc(self, pid):
|
||||||
self.pids.remove(pid)
|
try:
|
||||||
|
if pid in self.pids:
|
||||||
|
self.pids.remove(pid)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if len(self.pids) == 0:
|
if len(self.pids) == 0:
|
||||||
self.autohookmonitorthread()
|
self.autohookmonitorthread()
|
||||||
|
|
||||||
@ -449,8 +453,17 @@ class texthook(basetext):
|
|||||||
"错误", "权限不足,请以管理员权限运行!"
|
"错误", "权限不足,请以管理员权限运行!"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@threader
|
||||||
|
def waitend(self, pid):
|
||||||
|
windows.WaitForSingleObject(
|
||||||
|
windows.AutoHandle(windows.OpenProcess(windows.SYNCHRONIZE, False, pid)),
|
||||||
|
windows.INFINITE,
|
||||||
|
)
|
||||||
|
self.removeproc(pid)
|
||||||
|
|
||||||
def onprocconnect(self, pid):
|
def onprocconnect(self, pid):
|
||||||
self.pids.append(pid)
|
self.pids.append(pid)
|
||||||
|
self.waitend(pid)
|
||||||
for hookcode in self.needinserthookcode:
|
for hookcode in self.needinserthookcode:
|
||||||
self.Luna_InsertHookCode(pid, hookcode)
|
self.Luna_InsertHookCode(pid, hookcode)
|
||||||
gobject.baseobject.displayinfomessage(
|
gobject.baseobject.displayinfomessage(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user