Hello,
I am coding an application in C# that needs to know the current program and files a user has in focus.
I.e. I want to write functions like:
string GetProgramNameCurrentlyInFocus() { ... }
string GetFilenameCurrentlyInFocus() { ... }
Which return the current program executable filename (e.g. "word.exe") or the actual official program name (e.g. "Microsoft Word 2007"), and the current file that is being viewed by the user with the current program (e.g. "C:\Users\Mat\Documents\essay.doc"), respectively.
Products like RescueTime as well as SysInternals can do these things so it is possible. I can get the title of the current program in focus, but that is not good enough as some programs do not say the program name in the title.
So, does anyone know how to code functions like that? Any tips or places I should look?
Note: I've checked out SysInternal, and despite still being free, the source code is no longer available since Microsoft bought them out.
~Mat