private void button2_Click(object sender, EventArgs e)
{
//SendKeys.SendWait("%{PRTSC}");//アクティブウィンドウをスクリーンキャプチャする場合
SendKeys.SendWait("^{PRTSC}");//全画面をスクリーンキャプチャする場合
IDataObject data = Clipboard.GetDataObject();
if (data.GetDataPresent(DataFormats.Bitmap)) {
Bitmap bmp = (Bitmap)data.GetData(DataFormats.Bitmap);
bmp.Save(@"c:\data\screen3.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
}
}