private static extern bool GetWindowPlacement(IntPtr hwnd, WINDOWPLACEMENT lpwndpl);
 public static WINDOWPLACEMENT GetWindowPlacement(IntPtr hwnd)
 {
     WINDOWPLACEMENT wndpl = new WINDOWPLACEMENT();
     if (GetWindowPlacement(hwnd, wndpl))
     {
         return wndpl;
     }
     throw new Win32Exception();
 }