set-frame-selected-window

set-frame-selected-window is a built-in function in `C source code'.

(set-frame-selected-window FRAME WINDOW &optional NORECORD)

Set selected window of FRAME to WINDOW.
FRAME must be a live frame and defaults to the selected one. If FRAME
is the selected frame, this makes WINDOW the selected window. Optional
argument NORECORD non-nil means to neither change the order of recently
selected windows nor the buffer list. WINDOW must denote a live window.
Return WINDOW.