window-get-parent

long ( window-get-parent long window-id)

Gets the ID of the window's parent.