GetLastInputInfo getting system wide idle info
-
Hello All, I am using GetLastInputInfo in my MFC app to find the idle time for the app, but in my testing i found that it's giving system wide idle time. The reason i found that out is, i opened my app and let it stay on the background, and opened the outlook and started playing around with it. My app was supposed to be timed out after 1 min, but it didn't. Then i stopped playing with outlook for a minute, and then my app timed out. How to fix this?
-
Hello All, I am using GetLastInputInfo in my MFC app to find the idle time for the app, but in my testing i found that it's giving system wide idle time. The reason i found that out is, i opened my app and let it stay on the background, and opened the outlook and started playing around with it. My app was supposed to be timed out after 1 min, but it didn't. Then i stopped playing with outlook for a minute, and then my app timed out. How to fix this?
My take on GetLastInputInfo is that it's per user session not per application. To do what you need? I'm not sure. Maybe create a thread that listens for user input events sent to you app, and sends notification to your app to close after the specified time?