Example #1
0
        internal static Rect GetWindowDims(IntPtr hndl)
        {
            Rect returnRect = new Rect();
            WIN_RECT winLoc = new WIN_RECT();
            WIN_RECT winDim = new WIN_RECT();
            User32.GetWindowRect(hndl, ref winLoc);
            User32.GetClientRect(hndl, ref winDim);

            returnRect.X = winLoc.left;
            returnRect.Y = winLoc.top;
            returnRect.Width = winLoc.right - winLoc.left;
            returnRect.Height = winLoc.bottom - winLoc.top;
            return returnRect;
        }
Example #2
0
 public static extern IntPtr GetWindowRect(IntPtr hWnd, ref WIN_RECT rect);
Example #3
0
 public static extern IntPtr GetClientRect(IntPtr hWnd, ref WIN_RECT rect);