I'm using C# 4.0. I want to suppress alt-tab while a certain application is running and enable it when it's not. The re-enablement should happen when the app stops for any reason, including a crash.
IMessaageFilter doesn't seem to be the right way to do it since, as I understand it, alt-tab is Windows level and isn't passed in to the app.
I guess one way to do it would be to set a system-wide hook to suppress alt-tab. Then I could launch a separate process that checks periodically to see whether my app is running or not; if not, it would re-enable alt-tab and then exit.
But this seems really complicated. Is there an easier way?