Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. [C# 2008] How to detect any user interaction to implement a screensaver in a Compact Framework environment

[C# 2008] How to detect any user interaction to implement a screensaver in a Compact Framework environment

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpdotnethardwaretutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steve_9496613
    wrote on last edited by
    #1

    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

    L M 2 Replies Last reply
    0
    • S steve_9496613

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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)

      S 1 Reply Last reply
      0
      • L Lost User

        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)

        S Offline
        S Offline
        steve_9496613
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • S steve_9496613

          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

          M Offline
          M Offline
          Matt T Heffron
          wrote on last edited by
          #4

          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

          S 1 Reply Last reply
          0
          • M Matt T Heffron

            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

            S Offline
            S Offline
            steve_9496613
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups