How can I detect foreground application?

Printable View