R – What causes a window to not appear in the taskbar until it’s Alt-Tabbed to in Vista

taskbarwindows-vistawinforms

When our app is started programatically (either through custom action in MSI installer or when starting a new instance) in Windows Vista (also happens in Windows 7 Beta) it won't appear in the taskbar and isn't focused. Alt-tabbing to it will make it appear in the taskbar properly and stay there.

What causes this? I've seen this in some other apps before as well, but not sure why. Out app is .NET WinForms app. Never see this happen in XP, only Vista and 7

Edit: Well, it seems like the only time this happens reproducibly is when it's run by the installer, I believe there's other times it occurs, but I might just be crazy. The launching code is a bit complex to post because we handle various command line launch parameters and it launches a signin form before actually launching the main app etc.

Has anyone had to deal with this scenario before and worked it out?

Best Answer

Try checking your main application form "Form Border" property. If it's ToolWindow (Fixed or Sizable), try changing it to FixedDialog for example. This solved the problem in my case.

Related Topic