[Win11] Cannot catch display state after waking up

Jojo Tang 唐仕珊 41 Reputation points
2022-07-15T07:31:05.38+00:00

I register RegisterPowerSettingNotification(this->m_hWnd, &GUID_CONSOLE_DISPLAY_STATE, DEVICE_NOTIFY_WINDOW_HANDLE);
In Win11,
(1) Click sleep computer
(2) Click enter to wake up computer

OnPowerBroadcast() did not catch wake up event in Win11.

Win10 catching event normally with PBT_APMRESUMEAUTOMATIC.

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,361 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
7,670 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,206 Reputation points
    2022-07-19T07:39:52.567+00:00

    Hello JojoTang,

    It is possible that the Windows 11 SDK has not installed correctly or not all the features added.

    Please try to reinstall from: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

    And use the install syntax: winsdksetup.exe/features

    -------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments