[C# 2008] How to detect any user interaction to implement a screensaver in a Compact Framework environment
-
Regards to all, I'm writing an application in C# language (VS2008) that runs in a device with Windows Embedded Compact 7, so it uses Compact Framwork and not the full .NET framework. I need to implement something similar to a screensaver and to do this I need a timer to count time and I need to reset it anytime the user do anything. My problem is that I don't know how to detect easily user activity. The application has many pages, buttons, textboxes, tables so I can't put a timer reset in any control. I think there must be a clever way to do this, maybe some Application event but I don't know. Anyone can help me? Thanks in advance. Steve
-
Regards to all, I'm writing an application in C# language (VS2008) that runs in a device with Windows Embedded Compact 7, so it uses Compact Framwork and not the full .NET framework. I need to implement something similar to a screensaver and to do this I need a timer to count time and I need to reset it anytime the user do anything. My problem is that I don't know how to detect easily user activity. The application has many pages, buttons, textboxes, tables so I can't put a timer reset in any control. I think there must be a clever way to do this, maybe some Application event but I don't know. Anyone can help me? Thanks in advance. Steve
Not quite sure what you want; but in regular Windows, you open a form that covers the screen. Simply catch any input on that form (keydown, mousemove) to check for user-activity. If you need detect activity without an overlaying form, you would need to hook each control.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Not quite sure what you want; but in regular Windows, you open a form that covers the screen. Simply catch any input on that form (keydown, mousemove) to check for user-activity. If you need detect activity without an overlaying form, you would need to hook each control.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Thanks for your reply, Eddy. I think you have understood what I need. The screen saver will be a simple form that will pop up (ShowDialog) and cover anything. To close the "screensaver" I will catch any input on that form as you suggest. The problem is to start the screen saver. I can't (or I don't know how to) open a form that cover the screen but is transparent to user, I mean it lets the user interact with the application. To hook each control is really the only way? Thanks. Steve
-
Regards to all, I'm writing an application in C# language (VS2008) that runs in a device with Windows Embedded Compact 7, so it uses Compact Framwork and not the full .NET framework. I need to implement something similar to a screensaver and to do this I need a timer to count time and I need to reset it anytime the user do anything. My problem is that I don't know how to detect easily user activity. The application has many pages, buttons, textboxes, tables so I can't put a timer reset in any control. I think there must be a clever way to do this, maybe some Application event but I don't know. Anyone can help me? Thanks in advance. Steve
Look here: Detect user inactivity (systemwide)[^]
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
-
Look here: Detect user inactivity (systemwide)[^]
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
Thank you Matt. The link you suggest is a good starting point. Compact Framework is limited compared to the full .NET framework but the article Detecting user activity/inactivity in a Windows Mobile app[^] seems to be promising. Thanks for pointing me in the right direction. Steve