Skip to content

Commit

Permalink
尝试关机暂停
Browse files Browse the repository at this point in the history
  • Loading branch information
PencilMario committed Feb 25, 2024
1 parent e5f88d2 commit 6b825e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TrayIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +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
}
# 注册窗口类
wndclass = win32gui.WNDCLASS()
Expand Down Expand Up @@ -176,6 +177,11 @@ def OnCommand(self, hwnd, msg, wparam, lparam):
os._exit(0)
else:
print ("Unknown command -", id)
def OnEndSession(self, hwnd, msg, wparam, lparam):
self.stopflag=True
msg=self.legod.pause()
self.taskbar_msg("退出并暂停时长结果",msg)
return 0
def taskbar_msg(self,title,msg):
# Taskbar icon
nid =self.nid[4]
Expand Down

0 comments on commit 6b825e9

Please sign in to comment.