title: How to take screenshot of a window, which is behind top-most window?
body: <p>I am working on feedback form. When it's opened - user can check the flag to take screenshot of the screen. The problem is, that screenshot is taken with feedback form, and I need to capture screen without it.</p>
  
  <p>I've found some code to take screenshot. It works. To solve this,  I've tried to make this form invisible or closed during taking screenshot. Also, I've set it's opacity to 0 and height to 0. I think taking screenshot operation is too fast, so visually, the form cannot be hidden in such period of time.</p>
  
  <pre><code>    public void TakeScreenshot()
      {
          double screenLeft = SystemParameters.VirtualScreenLeft;
          double screenTop = SystemParameters.VirtualScreenTop;
          double screenWidth = SystemParameters.VirtualScreenWidth;
          double screenHeight = SystemParameters.VirtualScreenHeight;
  
          using (Bitmap bmp = new Bitmap((int)screenWidth, (int)screenHeight))
          {
              using (Graphics g = Graphics.FromImage(bmp))
              {
                  g.CopyFromScreen((int)screenLeft, (int)screenTop, 0, 0, bmp.Size);
                  bmp.Save(@"D:\printscreen.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
              }
          }
      }
  
  
      public void SendMessage()
      {
          MagicOpacity = 0;
          MailAddress from = new MailAddress(Mail, CurrentUser.Name);
          MailAddress to = new MailAddress("a@mail.com");
          MailMessage message = new MailMessage(from, to);
  
          if (SendWithScreenshot)
          {
              TakeScreenshot();
              message.Attachments.Add(new Attachment("D:\\printscreen.jpg"));
          }
  
          MagicOpacity = 1;
      }
  </code></pre>
  
  <p>EDIT: The form expands by Opacity of Border, used as toggle, the form is content of Border(opacity == 0(1) -> height = 0(500))</p>
  
  <pre><code>    public void ExpandFeedBackForm()
      {
          MagicOpacity = MagicOpacity == 0 ? 1 : 0;
      }
  
  &lt;Canvas&gt;
      &lt;Button Name="FeedBackButton" Command="{Binding ExpandFeedBackFormCommand}" FontWeight="Bold" FontSize="10" Height="18.5" Margin="-3,-8,0,0"/&gt;
      &lt;Border BorderBrush="Gray" BorderThickness="2" Opacity="{Binding MagicOpacity}" Name="border" Margin="-350,0,-178,-9" Background="White"
                      Canvas.Bottom="{Binding ElementName=FeedBackButton, Path=ActualHeight}"&gt;
          &lt;Border.Style&gt;
              &lt;Style TargetType="Border"&gt;
                  &lt;Style.Triggers&gt;
                      &lt;Trigger Property="Opacity"  Value="1"&gt;
                          &lt;Trigger.EnterActions&gt;
                              &lt;BeginStoryboard&gt;
                                  &lt;Storyboard&gt;
                                      &lt;DoubleAnimation Storyboard.TargetProperty="Height" From="0" To="500" Duration="0:0:0.4"/&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/BeginStoryboard&gt;
                          &lt;/Trigger.EnterActions&gt;
                      &lt;/Trigger&gt; 
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/Border.Style&gt;
          &lt;v:FeedBackView/&gt;
      &lt;/Border&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>MagicOpacity here is used for triggering animation using command(that's because Height property cannot be binded). But that is working,  so it doesn't matter.</p>
  
  <p>Even if I do not set the MagicOpacity to 1 after taking screenshot,  the form - is in the picture.</p>
  
  <p>So the question is that is it possible to take screenshot of window without top-most window?</p>