title: snapshot on C# (without monitor or even graphic card installed)
body: <p>I'm trying to record all what happens in my little program(video and audio). I've found on forums people mentioning that there can be a big problem if screenshot is made on the machine without monitor - no monitor physically connected or when graphics card places monitor in sleep mode or even without graphics card installed (servers). is there a way to solve this issue? currently i haven't access to server and even don't know it's configuration(((</p>
  
  <p>currently i'm using this code to make snapshots every 50 milliseconds and it's works great on desktop pc(can't check this code without monitor... i'm using HP touchsmart monoblock desktop) </p>
  
  <pre><code>            IntPtr myIntptr = FormElement.Handle;
              int hwndInt = myIntptr.ToInt32();
              IntPtr hwnd = myIntptr;
              Bitmap bm = new Bitmap(FormElement.Width, FormElement.Height);
              Graphics g = Graphics.FromImage(bm);
              IntPtr hdc = g.GetHdc();
              bool result = PrintWindow(hwnd, hdc, 0);
              g.ReleaseHdc(hdc);
              g.Flush();
              if (result == true)
              {
                  bm.Save(aFileName, ImageFormat.Jpeg);
              }
  </code></pre>
  
  <p>this doent work if i minimize my window and this is not good too.</p>
  
  <p>sorry for my english and thanx for any advice.</p>