c# - Detect when none of app windows is active/focused -


how detect when user changes focus multi-window application (alt+tab e.g.).

i want detect when none of app windows active/focused.

first window shown user can work 4 windows(none of these shown dialog).

form has containsfocus property indicates whether form, or 1 of child controls has input focus. can check property open forms detect if application contains focus or not:

var isactive = application.openforms.cast<form>().any(x=>x.containsfocus); 

if want notified of state of application in small periods of time, can use in tick event of timer.


Comments

Popular posts from this blog

Formatting string according to pattern without regex in php -

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -