I have used the code below to take the screenshot for a new window, but it is taking the screenshot for the previous window.
driver.findElement(By.xpath("html/body/div[2]/div[1]/div[1]/div[1]/a")).click();
Thread.sleep(15000);
File scrFile18 = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile18, new File("d:/Users/ Updates.png"));