If skype is the active window you can use GetForegroundWindow. If not, using the process name is a good option. You can also combine them and see if you get the same window handle.
The following code will grab an image from a window handle and save it to disk as an image. If you call this code often and modify the code to create unique images you will get several images like you ask for. GetWindowRect is the key function to get the coordinates for the window. And ofcourse you can save the image in any format you like. The WPF functions for saving images are quicker than the winform code used here.
public void GrabActiveWindow()
{
IntPtr handle = GetForegroundWindow(); // window handle of active application
IntPtr handle = WindowsHandleFromProcess("skype.exe");
RECT screenRect = new RECT();
GetWindowRect(handle, out screenRect);
long width = screenRect.Right - screenRect.Left;
long height = screenRect.Bottom - screenRect.Top;
Bitmap bmpScreenshot = new Bitmap( (int)width, (int)height, PixelFormat.Format32bppArgb);
Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
Size size = new Size((int)width, (int)height );
gfxScreenshot.CopyFromScreen(screenRect.Left, screenRect.Top, 0, 0, size, CopyPixelOperation.SourceCopy);
string path = @"c:\savepath.tiff";
bmpScreenshot.Save(path, ImageFormat.Tiff);
}
public IntPtr WindowsHandleFromProcess(string processName)
{
foreach (var process in Process.GetProcessesByName(processName))
{
return process.MainWindowHandle;
}
return IntPtr.Zero;
}
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();