How do I determine the name or exe of the app that currently has focus?
Posted on 2005-03-03
I want to code a function that will find out the name of the app that has focus.
For example, if the user is using Notepad or Minesweeper, and the function is called at that time (by a timer, for instance), it will display a message box that says "Notepad" or "Minesweeper". If instead of the name, it displays the exe ("notepad.exe" or "winmine.exe"), that's also acceptable.
I would like the implementation of that function, preferably in C# or VB.NET.