Can it achieve logout from the lock screen state?
Link-HXX opened this issue · 1 comments
Link-HXX commented
I am currently writing a C # service program that has a timed logout function that works well when logged in. But I still want to perform a logout after the time has passed in the locked screen state. I have tried the following methods:
Shutdown - l command
ExitWindowsEx (EWX_LOGOFF | EWX-FORCE, 0)
ApiDefinitions.CreateProcessAsUser(
UserTokenHandle,
Null,
Shutdown - l ",
IntPtr. Zero,
IntPtr. Zero,
False,
0
IntPtr. Zero,
Null,
Ref startInfo,
Out procInfo);
But none of them worked. Do you have any insights? Thank you very much!
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.