0

I have created a .NET Windows application in C#. I want to execute this application when the system becomes idle for sometime. The application is a user login application, i.e. when system becomes idle for sometime, a login page appears where the user logins with his username and password. Then only the user can continue using the system.

How can I make it work out? Please help as I am new in Windows applications.

I thought to run the application as a Windows service. I managed to run the application on Windows service start. But how can I trigger the app to run only when system goes to idle in Windows service? I also need to start the timer after the user logins to check idle time again. Please provide some code examples.

Smi
  • 13,850
  • 9
  • 56
  • 64
deepu
  • 1,993
  • 6
  • 42
  • 64
  • 1
    Do you want to create screan saver? or something else? It is not very clear what you mean as "mine is login application". – Alexei Levenkov Mar 01 '11 at 05:58
  • i think this should [help you out](http://stackoverflow.com/questions/4389119/how-to-calculate-system-idle-time-out-and-put-the-machine-to-sleep) – V4Vendetta Mar 01 '11 at 06:00
  • @Alexei Levenkov : i have edited the question hope u understand the question – deepu Mar 01 '11 at 06:06

2 Answers2

1

The system already comes with such functionality. On the screen saver configuration page you simply check the box titled "On resume, display logon screen". It can be configured with group policy.

There's absolutely no point re-implementing this.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • i am not implementing screen saver. i should make my application run when the system goes into idle state. – deepu Mar 03 '11 at 04:24
0

How about:

KMån
  • 9,896
  • 2
  • 31
  • 41
  • @deepu: then you should accept the answer that helped you the most and ask another question! – Martin Buberl Mar 01 '11 at 09:16
  • i have created an application.. my question was to start the app when system goes idle.. you have mention about making the app hidden.. i just need more information about it , i can only accept the answer only when the question is solved naa... – deepu Mar 01 '11 at 09:24
  • @deepu: Checkout the updated answer; [How to: Make a Startup Windows Form Invisible](http://msdn.microsoft.com/en-us/library/754w18dd.aspx) – KMån Mar 01 '11 at 14:41