+DEFUN ("w32-frame-rect", Fw32_frame_rect, Sw32_frame_rect, 0, 2, 0,
+ doc: /* Return boundary rectangle of FRAME in screen coordinates.
+FRAME must be a live frame and defaults to the selected one.
+
+The boundary rectangle is a list of four elements, specifying the left,
+top, right and bottom screen coordinates of FRAME including menu and
+title bar and decorations. Optional argument CLIENT non-nil means to
+return the boundaries of the client rectangle which excludes menu and
+title bar and decorations. */)
+ (Lisp_Object frame, Lisp_Object client)
+{
+ struct frame *f = decode_live_frame (frame);
+ RECT rect;
+
+ if (!NILP (client))
+ GetClientRect (FRAME_W32_WINDOW (f), &rect);
+ else
+ GetWindowRect (FRAME_W32_WINDOW (f), &rect);
+
+ return list4 (make_number (rect.left), make_number (rect.top),
+ make_number (rect.right), make_number (rect.bottom));
+}
+