Can .NET Define Focus Events (C #)?

Is it possible to determine when the focus of the window changes at the system level? I am writing a time tracking application, and I would like to be able to listen to application switching (so that I can start the registration time in this application). I sat the Process class for a good hour here, and although I learned a lot of useful things, I did not find what I was looking for. I suspect that I will need to use hooks, but it is difficult to find clear documentation for this process, not to mention documentation specific to what I ask.

+3
source share
1 answer

See SetWindowHooksEx.

" Windows .NET Framework":
http://msdn.microsoft.com/en-us/magazine/cc188966.aspx

+3

Source: https://habr.com/ru/post/1711907/


All Articles