How can I tell if the system is 'idle', or the screen saver is running, or the machine is locked?

  • Thread starter Thread starter Kevin Buchan
  • Start date Start date
K

Kevin Buchan

How can I tell if the system is 'idle', or the screen saver is
running, or the machine is locked?
I am writing an application that could really benefit from knowing
this information. During 'idle' time, I could do some of the slightly
heavier processing; during the 'working' time, I would display the
non-intrusive notifications that I don't want my customer to miss.

I see that I can apparently set the thread priority of my background
process to 'ProcessPriorityClass.Idle' and it should only kick off
when the system is idle, but I'm not certain if this is the 'best'
way... it sounds good, though.

Just some URLs or mention of some API's would be sufficient.

Thanks.


-Kevin Buchan
(e-mail address removed)
 
I would strongly recommend going with setting the priority of the thread. Why try to reinvent the wheel, when Microsoft has already done the dirty work for you?

Eric
 
(Followup message)

I cannot read the language that the comments were written in, but the
code is completely clear.

Thank you very much for this sample.


-Kevin Buchan
(e-mail address removed)
 
* Kevin Buchan said:
I cannot read the language that the comments were written in, but the
code is completely clear.

VB.NET is the language everybody here is speaking.

:-)
 
Back
Top