![]() The Tick event is also responsible of refreshing the status label (text and color) so that you can see the current state. In my demo, the interval property is set to 100 milliseconds so that you can quickly see the GUI change but in a real application, you should bump up this value to a larger number like 10000 (10 seconds) or more. In the Tick event, a method is called to calculate the current idle time. ![]() On the form there is a label to show the current state and a progress bar to simulate some kind of activity done while the user is inactive. It is a Windows forms application with a single form and a small class. The demo application is not doing anything useful but showing you how to detect idle time. Some readers will be happy to find both VB and C# code for this month demo application. I am neither detecting activity that could happen on the PC at the same time by another application. I am not talking about multithreading here even though this method could be mixed with some threading mechanism to bring this whole concept to another level. You might also want to scan a folder for some pending files to process. These time slots can be used to do anything that is not required in the next second but has to be done in the next hour for example.įor example, you might want to query back the database to refresh some fields on the screen. ![]() These applications detect what we call “idle time”. Many applications make a good use of the processing power while the user is not directly interacting with the computer by using the keyboard and/or the mouse. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |