title: How can I turn user monitor off and prevent turning on when user activity detected?
body: <p>I want to build a software that when a user press Ctrl+Alt+P the monitor turn off, he can type his password and when the monitor is off, after he finish typing he press Ctrl+Alt+O and got the screen back.</p>
  
  <p>I manage to do it all but the only problem I have is when the user start typing his password the computer detect user activity and turn the screen on automatically.</p>
  
  <p>I use this method to turn screen off</p>
  
  <pre><code>[DllImport("user32.dll", CharSet = CharSet.Auto)]
  private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
  
  public static void Main(string[] args)
  {
      Form f = new Form();
      bool turnOff;   //set true if you want to turn off, true if on
      SendMessage(f.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, turnOff ? 2 : -1);
  }
  </code></pre>
  
  <p>Anyone has an idea how can I prevent the monitor from turning on during user activity?</p>
  
  <p>I don't mind which script language to use, I prefer C#.</p>
  
  <p>Thanks ahead.</p>