public Image CaptureWindow(IntPtr handle) { IntPtr windowDC = Class14.GetWindowDC(handle); Class14.Struct16 struct2 = new Class14.Struct16(); Class14.GetWindowRect(handle, ref struct2); int num = struct2.int_2 - struct2.int_0; int num2 = struct2.int_3 - struct2.int_1; IntPtr ptr2 = Class13.CreateCompatibleDC(windowDC); IntPtr ptr3 = Class13.CreateCompatibleBitmap(windowDC, num, num2); IntPtr ptr4 = Class13.SelectObject(ptr2, ptr3); Class13.BitBlt(ptr2, 0, 0, num, num2, windowDC, 0, 0, 0xcc0020); Class13.SelectObject(ptr2, ptr4); Class13.DeleteDC(ptr2); Class14.ReleaseDC(handle, windowDC); Image image = Image.FromHbitmap(ptr3); Class13.DeleteObject(ptr3); return(image); }