Best way to take screenshot of a web page
===

What is the best way to take screenshot of a web page?
At the moment I just start an selenium instance of firefox and using winapi bring it to the front and make a screenshot.
I ask similar [question][1]  already.

There is two points:

 - Slowness.
 - If any window occurently gets higher than our web browser's window, this window will imprint in our screenshot.

Is there any method to take screenshot more 'programmly'?

Here is some code I use now:

    class FirefoxDriverEx : FirefoxDriver
    {
        public Process GetFirefoxProcess()
        {
            var fi = typeof(FirefoxBinary).GetField("process", BindingFlags.NonPublic | BindingFlags.Instance);
            return fi.GetValue(this.Binary) as Process;
        }
    }

Here is the code illustrating process of taking screenshot itself:

    using (FirefoxDriverEx driver = new FirefoxDriverEx())
    {
        driver.Navigate().GoToUrl(url);

        var process = driver.GetFirefoxProcess();

        if (process != null)
        {
            var screenCapture = new ScreenCapture();
            Win.SetForegroundWindow(process.MainWindowHandle.ToInt32());
        }
    }

Right now, I'm thinking about some manager that will control a queue of windows to take the screenshots from.


  [1]: http://stackoverflow.com/questions/11526260/get-window-handle-intptr-from-selenium-webdrivers-current-window-guid