public Rectangle GetWindowRectangle() { Rect rect = new Rect(); WindowApi.GetWindowRect(Handle, ref rect); return(rect.ToRectangle()); }
public virtual void Caputre() { if (!IsCaptureEnable) { return; } //UpdateRectangle(); WindowApi.PrintWindow(Handle, _memoryDC, 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; }
public Window FindChildWindow() { IntPtr handle = WindowApi.FindWindowEx(Handle, IntPtr.Zero, null, null); return(handle == IntPtr.Zero ? null : new Window(handle)); }
public static IntPtr FindWindow(string title) { return(WindowApi.FindWindow(null, title)); }
public void SendLeftMouseClick(Point point) { WindowApi.SetForegroundWindow(Handle); SendLeftMouseClick(point.X, point.Y); }