Skip to content

Commit

Permalink
改成WM_QUERYENDSESSION
Browse files Browse the repository at this point in the history
  • Loading branch information
PencilMario committed Feb 25, 2024
1 parent 6b825e9 commit f3dda19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TrayIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self):
win32con.WM_DESTROY: self.OnDestroy,
win32con.WM_COMMAND: self.OnCommand,
win32con.WM_USER + 20: self.OnTaskbarNotify,
win32con.WM_ENDSESSION: self.OnEndSession
win32con.WM_QUERYENDSESSION: self.OnEndSession
}
# 注册窗口类
wndclass = win32gui.WNDCLASS()
Expand Down Expand Up @@ -181,7 +181,7 @@ def OnEndSession(self, hwnd, msg, wparam, lparam):
self.stopflag=True
msg=self.legod.pause()
self.taskbar_msg("退出并暂停时长结果",msg)
return 0
return True
def taskbar_msg(self,title,msg):
# Taskbar icon
nid =self.nid[4]
Expand Down

0 comments on commit f3dda19

Please sign in to comment.