mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-10 17:49:20 +08:00
[feat] expose system controls and verify remote unlock completion
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "screen_lock.h"
|
||||
#include "service/interactive_desktop.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -12,6 +13,13 @@
|
||||
|
||||
namespace crossdesk {
|
||||
|
||||
ScreenLockState QueryScreenLock() {
|
||||
std::string reason;
|
||||
if (IsCurrentSessionUnlocked(&reason)) return ScreenLockState::unlocked;
|
||||
return reason.rfind("session_not_unlocked", 0) == 0 ? ScreenLockState::locked
|
||||
: ScreenLockState::unknown;
|
||||
}
|
||||
|
||||
bool LockScreen() {
|
||||
if (LockWorkStation()) return true;
|
||||
LOG_WARN("LockWorkStation failed: {}", GetLastError());
|
||||
|
||||
Reference in New Issue
Block a user