Windows使用Win32 API进入待机或休眠状态之前接收事件 [英] Receive event before Windows enters standby or hibernate using Win32 API

查看:408
本文介绍了Windows使用Win32 API进入待机或休眠状态之前接收事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个用C ++/Qt编写的小型聊天应用程序.我的用户抱怨说,当他们合上笔记本电脑盖并且计算机进入待机状态时,连接无法正常关闭.

I'm working on a small chat application written in C++/Qt. My users are complaining that the connection is not shut down gracefully when they are closing the laptop lid and the computer enters standby.

Windows即将进入待机状态时,是否存在一个可用的Win32挂钩?

Is there a Win32 hook available that is called when Windows is about to enter standby?

推荐答案

WM_POWERBROADCAST

这篇关于Windows使用Win32 API进入待机或休眠状态之前接收事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆