title: Getting Position of mouse cursor when clicked out side the form's boundary
body: <p>It is very easy to get the position of cursor out side the form's boundary by just dragaging the mouse it sends many values to the form when ever the position changes, form the following line of code.</p>
  
  <pre><code>MessageBox.Show(Cursor.Position.ToString());
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ckeUG.png" alt="MessageBox showing mouse position."> </p>
  
  <p>But I need to get the mouse position when user <strong>clicked</strong> out side the forms boundary.
  Not by just hovering the mouse. I used the following line of Code to do this:</p>
  
  <pre><code>private void Form1_Deactivate(object sender, EventArgs e)
  {
      MessageBox.Show(Cursor.Position.ToString());
  }
  </code></pre>
  
  <p>I placed <strong>MessageBox.Show(Cursor.Position.ToString());</strong> into forms Deactivate event. When user click outside the form this event definitely occures. But it also sends wrong values when user does not click outside but changes the program by using <strong>ALT + TAB</strong> key combination.</p>
  
  <p>Actually I have to capture screen shot of the area starting from the position of first click. Therefore I need the position of the cursor when it is clicked outside the form.
  like:
  <img src="https://i.stack.imgur.com/JQSei.png" alt="enter image description here"></p>