How can you tell when a window was opened in an external application?