Python freezes after computer sleep/hibernate

☆樱花仙子☆ 提交于 2019-12-06 06:03:32

You can catch WM_POWERBROADCAST window message with PBT_APMQUERYSUSPEND event inside it. To catch this message inside Python program, you can create new invisible window and make separate thread repeatedly calling GetMessage().

In the worst case you can archieve all these by using ctypes only, but you can also use pywin32, sometimes referred to as win32py.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!