Example #1
0
        public Rectangle GetWindowRectangle()
        {
            Rect rect = new Rect();

            WindowApi.GetWindowRect(Handle, ref rect);
            return(rect.ToRectangle());
        }
Example #2
0
        public virtual void Caputre()
        {
            if (!IsCaptureEnable)
            {
                return;
            }

            //UpdateRectangle();

            WindowApi.PrintWindow(Handle, _memoryDC, 0);
        }
Example #3
0
        public void CreateEnvironment()
        {
            Trace.Assert(_windowDC == IntPtr.Zero);
            Trace.Assert(_memoryDC == IntPtr.Zero);
            Trace.Assert(MemoryBitmapHandle == IntPtr.Zero);

            _windowDC = WindowApi.GetWindowDC(Handle);
            _memoryDC = GdiApi.CreateCompatibleDC(_windowDC);

            var rect = GetWindowRectangle();

            MemoryBitmapHandle = GdiApi.CreateCompatibleBitmap(_windowDC, rect.Width,
                                                               rect.Height);

            GdiApi.SelectObject(_memoryDC, MemoryBitmapHandle);

            IsCaptureEnable = true;
        }
Example #4
0
        public Window FindChildWindow()
        {
            IntPtr handle = WindowApi.FindWindowEx(Handle, IntPtr.Zero, null, null);

            return(handle == IntPtr.Zero ? null : new Window(handle));
        }
Example #5
0
 public static IntPtr FindWindow(string title)
 {
     return(WindowApi.FindWindow(null, title));
 }
Example #6
0
 public void SendLeftMouseClick(Point point)
 {
     WindowApi.SetForegroundWindow(Handle);
     SendLeftMouseClick(point.X, point.Y);
 }