How can I get the title of the window that the user is currently focused on? I am making a program that starts with another window, and if the user is not focused on this window, I can not find a reason to update my program.
So, how can I determine in which window the user is focused?
I tried to peek into
[DllImport("user32.dll")]
static extern IntPtr GetActiveWindow();
but I seem to be able to use this only if Window is part of my application, and it is not.
source
share