I want to write a utility for our web test server which kills all processes having an "always on top" window. I guess it is window style WS_EX_TOPMOST
, however, I'm not 100% sure.
Is there a way in C#:
- to enumerate all windows which are "always on top"
- and to retrieve the corresponding process?
Here's a working example which finds all processes which have a topmost window. Be careful though: Windows Explorer always has a topmost window and you probably don't want to kill that process.