mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
Update utils.py
This commit is contained in:
parent
2d26b27b0e
commit
cef3d14356
@ -427,18 +427,21 @@ def minmaxmoveobservefunc(self):
|
||||
def win_event_callback(
|
||||
hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime
|
||||
):
|
||||
|
||||
try:
|
||||
if not gobject.baseobject.hwnd:
|
||||
myhwnd = gobject.baseobject.hwnd
|
||||
if not myhwnd:
|
||||
return
|
||||
mymyhwnd = windows.GetAncestor(myhwnd)
|
||||
if myhwnd != mymyhwnd:
|
||||
gobject.baseobject.hwnd = myhwnd = mymyhwnd
|
||||
if (
|
||||
event == windows.EVENT_OBJECT_DESTROY
|
||||
and idObject == windows.OBJID_WINDOW
|
||||
):
|
||||
if hwnd == gobject.baseobject.hwnd:
|
||||
if hwnd == myhwnd:
|
||||
gobject.baseobject.hwnd = None
|
||||
return
|
||||
p_pids = windows.GetWindowThreadProcessId(gobject.baseobject.hwnd)
|
||||
p_pids = windows.GetWindowThreadProcessId(myhwnd)
|
||||
if not p_pids:
|
||||
# 有时候谜之没有EVENT_OBJECT_DESTROY/僵尸进程
|
||||
gobject.baseobject.hwnd = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user