Cannot receive WM_POWERBROADCAST message on Win10 2004

Ningnan NN1 Feng 21 Reputation points
2020-07-16T10:07:29.177+00:00

I write an application with C++, , I regist the system message notification already.when it runs on win10 1809, it can receive WM_POWERBROADCAST message, but when it runs on Win10 2004, WM_POWERBROADCAST message cannot received, I am really confused.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,418 questions
{count} votes

Accepted answer
  1. mkdr 96 Reputation points
    2020-07-19T00:56:34.807+00:00

    The problem mostly is, that your laptop is now forced into modern standby, which started (the force of modern standby, not modern standby itself) with 2004. If you use modern standby, you need to register and unregister for notifications like this:

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registersuspendresumenotification

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-unregistersuspendresumenotification


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more