示例#1
0
        public static Rectangle GetPositionSize(IntPtr hwnd)
        {
            var info = new tagWINDOWINFO();
            info.cbSize = (uint)Marshal.SizeOf(info);
            GetWindowInfo(hwnd, ref info);

            var rect = new Rectangle();
            rect.X = info.rcWindow.left;
            rect.Y = info.rcWindow.top;
            rect.Width = info.rcWindow.right - info.rcWindow.left;
            rect.Height = info.rcWindow.bottom - info.rcWindow.top;
            return rect;
        }
示例#2
0
        public static Rectangle GetSize(IntPtr hwnd)
        {
            var info = new tagWINDOWINFO();

            info.cbSize = (uint)Marshal.SizeOf(info);
            var returnRectangle = new Rectangle();

            GetWindowInfo(hwnd, ref info);
            returnRectangle.X      = info.rcClient.left;
            returnRectangle.Y      = info.rcClient.top;
            returnRectangle.Width  = info.rcClient.right - returnRectangle.X;
            returnRectangle.Height = info.rcClient.bottom - returnRectangle.Y;
            return(returnRectangle);
        }
示例#3
0
        public static Rectangle GetPositionSize(IntPtr hwnd)
        {
            var info = new tagWINDOWINFO();

            info.cbSize = (uint)Marshal.SizeOf(info);
            GetWindowInfo(hwnd, ref info);

            var rect = new Rectangle();

            rect.X      = info.rcWindow.left;
            rect.Y      = info.rcWindow.top;
            rect.Width  = info.rcWindow.right - info.rcWindow.left;
            rect.Height = info.rcWindow.bottom - info.rcWindow.top;
            return(rect);
        }
示例#4
0
 private static extern bool GetWindowInfo(IntPtr hwnd, ref tagWINDOWINFO pwi);
示例#5
0
 public static Rectangle GetSize(IntPtr hwnd)
 {
     var info = new tagWINDOWINFO();
     info.cbSize = (uint) Marshal.SizeOf(info);
     var returnRectangle = new Rectangle();
     GetWindowInfo(hwnd, ref info);
     returnRectangle.X = info.rcClient.left;
     returnRectangle.Y = info.rcClient.top;
     returnRectangle.Width = info.rcClient.right - returnRectangle.X;
     returnRectangle.Height = info.rcClient.bottom - returnRectangle.Y;
     return returnRectangle;
 }
示例#6
0
 private static extern bool GetWindowInfo(IntPtr hwnd, ref tagWINDOWINFO pwi);