fgl_window_current() makes the specified window, named window1 in this example, the active window.
CALL fgl_window_current("window1")
Here is a simple example program:
MAIN
OPEN WINDOW win1 AT 3,3 WITH 20 ROWS, 70 COLUMNS ATTRIBUTES(BORDER)
CALL fgl_winmessage("fgl_window_current()", "WIN1: This window was opened as 'win1' and now has focus", "info")
OPEN WINDOW win2 AT 6,10 WITH 10 ROWS, 60 COLUMNS ATTRIBUTES(BORDER)
CALL fgl_winmessage("fgl_window_current()", "WIN2: This window was opened as 'win2' and now has focus", "info")
CALL fgl_winmessage("fgl_window_current()", "Now, we change focus to 'win1' using fgl_window_current()", "info")
CALL fgl_window_current("win1")
CALL fgl_winmessage("fgl_window_current()", "WIN1: Window 'Win1' has now got focus again", "info")
CALL fgl_winmessage("fgl_window_current()", "Now, we change focus to 'win2' using fgl_window_current()", "info")
CALL fgl_window_current("win2")
CALL fgl_winmessage("fgl_window_current()", "WIN2: Window 'Win2' has now got focus again - Press OK to close application", "info")
END MAIN