Skip to content

Detect System state hibernate sleep awake #828

Answered by alihassan143
alihassan143 asked this question in Q&A
Discussion options

You must be logged in to vote

RegisterPowerSettingNotification(GetHandle(), &GUID_CONSOLE_DISPLAY_STATE, DEVICE_NOTIFY_WINDOW_HANDLE)
WTSRegisterSessionNotification(GetHandle(),NOTIFY_FOR_THIS_SESSION);

registering these 2 notfication  i successfully able to receive message in message handler
switch (message) {
    case WM_FONTCHANGE:
      flutter_controller_->engine()->ReloadSystemFonts();
      break;
      case WM_POWERBROADCAST:
            if (wparam == PBT_POWERSETTINGCHANGE) {
                POWERBROADCAST_SETTING *setting = (POWERBROADCAST_SETTING *)lparam;
                if (IsEqualGUID(setting->PowerSetting, GUID_CONSOLE_DISPLAY_STATE)) {
                    DWORD consoleDisplayState = *(DWORD*)setting->…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alihassan143
Comment options

Answer selected by alihassan143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #827 on March 06, 2024 14:00.