/// <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()); }
/// <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()); }
public NPoint(NPoint copy) { X = copy.X; Y = copy.Y; }
private static extern bool ScreenToClient(IntPtr hwnd, ref NPoint point);
private static extern bool ClientToScreen(IntPtr hwnd, ref NPoint point);
public static extern IntPtr RealChildWindowFromPoint(IntPtr parent, NPoint point);