XPIsWidgetInFront

WIDGET_API int        XPIsWidgetInFront(
                         XPWidgetID           inWidget);

This routine returns true if this widget’s hierarchy is the frontmost hierarchy. It returns false if the widget’s hierarchy is not in front, or if the widget is not in a rooted hierarchy.