Exemple #1
0
        /// <summary>
        ///     Converts a point in screen coordinates in client coordinates relative to a window.
        /// </summary>
        /// <param name="hwnd">Handle of the window whose client coordinate system should be used.</param>
        /// <param name="screenPoint">Point expressed in screen coordinates.</param>
        /// <returns>Point expressed in client coordinates.</returns>
        public static NPoint ScreenToClient(IntPtr hwnd, NPoint screenPoint)
        {
            var localCopy = new NPoint(screenPoint);

            if (ScreenToClient(hwnd, ref localCopy))
            {
                return(localCopy);
            }

            return(new NPoint());
        }
Exemple #2
0
        /// <summary>
        ///     Converts a point in client coordinates of a window to screen coordinates.
        /// </summary>
        /// <param name="hwnd">Handle to the window of the original point.</param>
        /// <param name="clientPoint">Point expressed in client coordinates.</param>
        /// <returns>Point expressed in screen coordinates.</returns>
        public static NPoint ClientToScreen(IntPtr hwnd, NPoint clientPoint)
        {
            var localCopy = new NPoint(clientPoint);

            if (ClientToScreen(hwnd, ref localCopy))
            {
                return(localCopy);
            }

            return(new NPoint());
        }
Exemple #3
0
 public NPoint(NPoint copy)
 {
     X = copy.X;
     Y = copy.Y;
 }
Exemple #4
0
 private static extern bool ScreenToClient(IntPtr hwnd, ref NPoint point);
Exemple #5
0
 private static extern bool ClientToScreen(IntPtr hwnd, ref NPoint point);
Exemple #6
0
 public static extern IntPtr RealChildWindowFromPoint(IntPtr parent, NPoint point);