Example #1
0
File: WinAPI.cs Project: antgraf/BA
 public bool Equals(WindowRect rectangle)
 {
     return rectangle.Left == _Left && rectangle.Top == _Top && rectangle.Right == _Right && rectangle.Bottom == _Bottom;
 }
Example #2
0
File: WinAPI.cs Project: antgraf/BA
 internal static extern bool GetWindowRect(IntPtr hWnd, ref WindowRect rect);
Example #3
0
File: Window.cs Project: antgraf/BA
 public static Window FromHandle(IntPtr hwnd)
 {
     WindowRect rect = new WindowRect();
     if(hwnd == IntPtr.Zero || !WinApi.GetWindowRect(hwnd, ref rect))
     {
         return null;
     }
     Window window = new Window
                         {
                             Handle = new WindowHandle() {Handle = hwnd},
                             X = rect.X,
                             Y = rect.Y,
                             Width = rect.Width,
                             Height = rect.Height,
                             Title = GetTitle(hwnd)
                         };
     return window;
 }