public static Point winGetPosition(IntPtr hwnd) { WINDOWPLACEMENT placement = new WINDOWPLACEMENT(); placement.length = Marshal.SizeOf(placement); GetWindowPlacement(hwnd, ref placement); return new Point(placement.rcNormalPosition.X, placement.rcNormalPosition.Y); }
public static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);