danbtl
danbtl

Reputation: 116

Receive event before Windows enters standby or hibernate using Win32 API

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.

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

Upvotes: 1

Views: 2205

Answers (2)

Symbiosoft
Symbiosoft

Reputation: 4711

Reimplement QCoreApplication::winEventFilter in your application to handle Windows standby events.

Upvotes: 1

Luke
Luke

Reputation: 11421

WM_POWERBROADCAST

Upvotes: 2

Related Questions