コード例 #1
0
ファイル: WindowMethods.cs プロジェクト: Hiale/ontopreplica
 /// <summary>
 /// Converts client size rectangle to window rectangle, according to window styles.
 /// </summary>
 /// <param name="clientRectangle">Client area bounding box.</param>
 /// <param name="windowStyle">Style of window to compute.</param>
 /// <param name="extendedWindowStyle">Extended style of window to compute.</param>
 public static NRectangle ConvertClientToWindowRect(NRectangle clientRectangle, long windowStyle, long extendedWindowStyle)
 {
     NRectangle tmp = clientRectangle;
     if (AdjustWindowRectEx(ref tmp, windowStyle, false, extendedWindowStyle)) {
         return tmp;
     }
     else {
     #if DEBUG
         throw new InvalidOperationException("Failed to convert client rectangle to window rectangle");
     #else
         return clientRectangle;
     #endif
     }
 }
コード例 #2
0
        /// <summary>
        /// Converts client size rectangle to window rectangle, according to window styles.
        /// </summary>
        /// <param name="clientRectangle">Client area bounding box.</param>
        /// <param name="windowStyle">Style of window to compute.</param>
        /// <param name="extendedWindowStyle">Extended style of window to compute.</param>
        public static NRectangle ConvertClientToWindowRect(NRectangle clientRectangle, long windowStyle, long extendedWindowStyle)
        {
            NRectangle tmp = clientRectangle;

            if (AdjustWindowRectEx(ref tmp, windowStyle, false, extendedWindowStyle))
            {
                return(tmp);
            }
            else
            {
#if DEBUG
                throw new InvalidOperationException("Failed to convert client rectangle to window rectangle");
#else
                return(clientRectangle);
#endif
            }
        }
コード例 #3
0
ファイル: WindowMethods.cs プロジェクト: Hiale/ontopreplica
 public static extern bool GetClientRect(IntPtr handle, out NRectangle rect);
コード例 #4
0
ファイル: WindowMethods.cs プロジェクト: Hiale/ontopreplica
 private static extern bool AdjustWindowRectEx(ref NRectangle clientToWindowRect, long windowStyle, bool hasMenu, long extendedWindowStyle);
コード例 #5
0
ファイル: WindowMethods.cs プロジェクト: Hiale/ontopreplica
 public static extern bool GetWindowRect(IntPtr handle, out NRectangle rect);
コード例 #6
0
 public static extern bool GetWindowRect(IntPtr handle, out NRectangle rect);
コード例 #7
0
 public static extern bool GetClientRect(IntPtr handle, out NRectangle rect);
コード例 #8
0
 private static extern bool AdjustWindowRectEx(ref NRectangle clientToWindowRect, long windowStyle, bool hasMenu, long extendedWindowStyle);