You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a nice feature to automatically disable listen mode in UltraVNC Viewer then the PC is idle and enable it back again when the user gets back.
It would be helpful to:
Find out if the user is available to receive the connection.
#include <iostream>
#include <windows.h>
// Function to get the idle time in seconds
DWORD GetIdleTime() {
LASTINPUTINFO lastInputInfo;
lastInputInfo.cbSize = sizeof(LASTINPUTINFO);
if (GetLastInputInfo(&lastInputInfo)) {
DWORD currentTime = GetTickCount();
return (currentTime - lastInputInfo.dwTime) / 1000;
}
return 0;
}
int main() {
while (true) {
DWORD idleTime = GetIdleTime();
std::cout << "Idle time in seconds: " << idleTime << std::endl;
Sleep(1000); // Sleep for 1 second before checking again
}
return 0;
}
The text was updated successfully, but these errors were encountered:
That would be really useful too for most cases, although I never use screen lock in my home PC (which is also my work PC).
About the case of "idle + watching YouTube", it looks like there's no public API to check if there are any Video Wake Locks active, but it might be good enough to check if the current monitor has gone to sleep mode:
It would be a nice feature to automatically disable listen mode in UltraVNC Viewer then the PC is idle and enable it back again when the user gets back.
It would be helpful to:
I believe it could be done with GetLastInputInfo from windows.h:
https://learn.microsoft.com/bs-latn-ba/windows/win32/api/winuser/nf-winuser-getlastinputinfo
Here's an example snippet:
The text was updated successfully, but these errors were encountered: