Example #1
0
 public static Rectangle GetExtendedFrameBounds(IntPtr window)
 {
     WinApi.RECT output = new WinApi.RECT();
     if (WinApi.DwmGetWindowAttribute(window, WinApi.DWMWINDOWATTRIBUTE.ExtendedFrameBounds, out output, Marshal.SizeOf(output)) == 0)
     {
         return(output);
     }
     return(GetWindowBounds(window));
 }
Example #2
0
 public static Rectangle GetWindowBounds(IntPtr window)
 {
     WinApi.RECT output = new WinApi.RECT();
     if (WinApi.GetWindowRect(window, out output))
     {
         return(output);
     }
     throw new Exception(string.Format("Couldn't get bounds of window {0}", window));
 }