Describe the bug
I use SystemEvents hook API in App_Launched function for computer asleep hook. Here is my code
SystemEvents.PowerModeChanged += OnPowerChange;
private void OnPowerChange(object s, PowerModeChangedEventArgs e)
{
switch ( e.Mode )
{
case PowerModes.Resume:
break;
case PowerModes.Suspend:
break;
}
}
But it does not work after I let my computer sleep and asleep.
Steps to reproduce the bug
Steps to reproduce the behavior:
- Add the code above
- Sleep and wake computer , the event could not be triggered
Expected behavior
The event could be detected.
Version Info
NuGet package version:
[WinUI 3 - Project Reunion 0.5: 0.5.0]
Windows app type:
Win32
OS:
October 2020 Update (19042)
Desktop
Describe the bug
I use SystemEvents hook API in App_Launched function for computer asleep hook. Here is my code
SystemEvents.PowerModeChanged += OnPowerChange;
private void OnPowerChange(object s, PowerModeChangedEventArgs e)
{
switch ( e.Mode )
{
case PowerModes.Resume:
break;
case PowerModes.Suspend:
break;
}
}
But it does not work after I let my computer sleep and asleep.
Steps to reproduce the bug
Steps to reproduce the behavior:
Expected behavior
The event could be detected.
Version Info
NuGet package version:
[WinUI 3 - Project Reunion 0.5: 0.5.0]
Windows app type:
Win32
OS:
October 2020 Update (19042)
Desktop