Best way to hide a window from the Alt-Tab program switcher?

Posted by chaiguy1337 on Stack Overflow See other posts from Stack Overflow or by chaiguy1337
Published on 2008-12-10T18:31:39Z Indexed on 2010/04/30 3:37 UTC
Read the original article Hit count: 342

Filed under:
|
|
|

I've been a .NET developer for several years now and this is still one of those things I don't know how to do properly. It's easy to hide a window from the taskbar via a property in both Windows Forms and WPF, but as far as I can tell, this doesn't guarantee (or necessarily even affect) it being hidden from the Alt-Tab dialog. I've seen invisible windows show up in Alt-Tab, and I'm just wondering what is the best way to guarantee a window will never appear (visible or not) in the Alt-Tab dialog.

Update: Please see my posted solution below. I'm not allowed to mark my own answers as the solution, but so far it's the only one that works.

Update 2: There's now a proper solution by Franci Penov that looks pretty good, but haven't tried it out myself. Involves some Win32, but avoids the lame creation of off-screen windows.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf