The function screen-active-interface
returns the currently active interface on the screen
screen,
or nil
if no CAPI interface is active or if this cannot be determined.
screen-active-interface
also works with document-container, returning the active interface within the container.
CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017