1

I want To Invoke the Following Method while Turn off the Monitor

    Stopwatch sw =new Stopwatch();        
    sw.Stop();

also i want to invoke the following Method while Turn on the Monitor

    sw.Start(); 

Is there any possible way to do this in c#?

Vinoth
  • 851
  • 7
  • 23
  • 1
    Possible duplicate of [c# How to get the events when the screen/display goes to power OFF or ON?](http://stackoverflow.com/questions/2208595/c-sharp-how-to-get-the-events-when-the-screen-display-goes-to-power-off-or-on) – Backs Oct 07 '15 at 05:34
  • In this link i dint get how to invoke methods while turnoff and turn on using monitor button – Vinoth Oct 07 '15 at 06:26

1 Answers1

3

Turning off monitor is completely different from operating system function. In a windows system it shows just the output given by the System. It does not take any input to the system. So you cannot add any functionality to your program using the power button of the monitor. If the monitor turns off automatically by the power management system you can trigger events but not by pressing power button of monitor.

Noxious Reptile
  • 838
  • 1
  • 7
  • 24