feat: support suspend/resume on Windows (#24251)
This commit is contained in:
parent
abf2e9c93d
commit
6369748a2a
2 changed files with 8 additions and 2 deletions
|
@ -73,6 +73,12 @@ LRESULT CALLBACK PowerMonitor::WndProc(HWND hwnd,
|
|||
Emit("unlock-screen");
|
||||
}
|
||||
}
|
||||
} else if (message == WM_POWERBROADCAST) {
|
||||
if (wparam == PBT_APMRESUMEAUTOMATIC) {
|
||||
Emit("resume");
|
||||
} else if (wparam == PBT_APMSUSPEND) {
|
||||
Emit("suspend");
|
||||
}
|
||||
}
|
||||
return ::DefWindowProc(hwnd, message, wparam, lparam);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue