Here is what I found out in my investigations tonight...
1) A true background application (an application which has its registration XML category set to "Background" as outlined in http://msdn2.microsoft.com/en-us/library/aa468319.aspx) will always return false for ApplicationContext.IsForegroundApplication Property.
2) For any other type of application, the ApplicationContext.IsForegroundApplication Property will return true for all instances of that app even though some instances are technically on the back stack and not truly in the foreground. This is probably due to how the extensibility host is architected to load assemblies -- as far as it is concerned, the assembly is in the foreground.
3) I've only been able to get 7 instances of an application running. Based on your comments this is probably 6 copies too many for you Zakspeed.
4) I doubt 7 instances will happen very often due to the fact we unload applications as Windows Media Center pages or other apps get added to the backstack. For seven to appear I have to add the application launch tile to the Windows Media Center Start Menu and cycle through Launch > Green Button > Launch. If I don't add the application tile to the Windows Media Center Start Menu and the user goes through Program Library the max number of instances you can get is three.
5) Chances are if the user launches your app and navigates elsewhere in Windows Media Center (including launching of other apps) you will only have a single instance, and it will be a new instance. We have a maximum number of eight (8) Windows Media Center pages + app instances. Once the eighth page or app is added, we truncate the end of the stack. If that item is an app we call the apps IAddInModule.Uninitialize method and give the app a small window of time to tidy up before terminating the application. For more information see http://msdn2.microsoft.com/en-us/library/bb189705.aspx. Launching an app, then drilling down a few pages into another single feature (Music, Pictures, Videos) then returning to launch the app in Program Library almost always meant I got a single app.
6) I cannot stress enough that applications should expect and anticipate to be interrupted at any time. For example, if needed, you should be saving state to a common location so any new application instances can pick up that state if launched. The SDK hyperlink in #5 outlines this in some more detail. We architected the Z sample app in the area of its download manager to mitigate this problem. The download manager runs outside of Windows Media Center and does the 'heavy lifting' of long running tasks so the app instance can unload at any time.
7) We are aware of the shortcomings of the multiple instance approach and are planning to change this in a future version of the platform (while maintaining backward compatbility). As to your next question: Sorry, no ETA on when that might be available. Even when you get a single instance model, you will still need to architect the app as outlined in #6.
Hope this helps...
Charlie Owen (Microsoft)