Lex,
You can probably set up a system-wide hook through a call to the
SetWindowsHookEx function in the Win32 API. You should be able to set up a
hook of type WH_CALLWNDPROC, and then check for messages that are posted to
windows when they get or lose focus.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Lex" <de**@homerlex.mailshell.com> wrote in message
news:c5*************************@posting.google.co m...
I want to write an app in C# that keeps track of when the foreground
window in the OS changes. Is there an event that I can "susbscribe"
to for this? Or am I stuck polling using the GetForegroundWindow()
method?
Regards