日期:2014-05-20 浏览次数:20936 次
private void snappic() { UInt32 li = GetWindowHwndByText("计算器"); if (li == 0) return; RECT r; GetWindowRect(li, out r); Bitmap bitmap = new Bitmap(r.Right - r.Left, r.Bottom - r.Top); Graphics g = Graphics.FromImage(bitmap); bool a = PrintWindow(li, g.GetHdc(), 0); g.ReleaseHdc(); pictureBox1.Image = bitmap; }