Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
/// then in a sub / click event...
Dim VK_SNAPSHOT As Integer = &H2C
keybd_event(VK_SNAPSHOT, 0, 0, 0)
private Image GetScreenShot(bool activeWindowOnly)
{
if(activeWindowOnly)
{
SendKeys.SendWait("%{PRTSC}");
}
else
{
SendKeys.SendWait("{PRTSC 2}");
}
return (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
}