Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个用 C++/Qt 编写的小型聊天应用程序。我的用户抱怨当他们关闭笔记本电脑盖并且计算机进入待机状态时,连接没有正常关闭。
当 Windows 即将进入待机状态时,是否有可用的 Win32 挂钩?
WM_POWERBROADCAST
在您的应用程序中重新实现QCoreApplication::winEventFilter以处理 Windows 待机事件。