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 Reference Manual - 15 Dec 2011