Exemplo n.º 1
0
        public static Image CaptureWindow(IntPtr handle)
        {
            IntPtr windowDC = CaptureHelper.User32.GetWindowDC(handle);

            CaptureHelper.User32.RECT rECT = default(CaptureHelper.User32.RECT);
            CaptureHelper.User32.GetWindowRect(handle, ref rECT);
            int    nWidth   = rECT.right - rECT.left;
            int    nHeight  = rECT.bottom - rECT.top;
            IntPtr arg_44_0 = CaptureHelper.GDI32.CreateCompatibleDC(windowDC);
            IntPtr intPtr   = CaptureHelper.GDI32.CreateCompatibleBitmap(windowDC, nWidth, nHeight);
            IntPtr hObject  = CaptureHelper.GDI32.SelectObject(arg_44_0, intPtr);

            CaptureHelper.GDI32.BitBlt(arg_44_0, 0, 0, nWidth, nHeight, windowDC, 0, 0, 13369376);
            CaptureHelper.GDI32.SelectObject(arg_44_0, hObject);
            CaptureHelper.GDI32.DeleteDC(arg_44_0);
            CaptureHelper.User32.ReleaseDC(handle, windowDC);
            Image arg_87_0 = Image.FromHbitmap(intPtr);

            CaptureHelper.GDI32.DeleteObject(intPtr);
            return(arg_87_0);
        }
Exemplo n.º 2
0
 public static extern IntPtr GetWindowRect(IntPtr hWnd, ref CaptureHelper.User32.RECT rect);