I have a tray application that I want to make sure is always running in each of any number of interactive sessions in Windows. I think a service should be able to accomplish this.
Here is a pseudo-code (I don't now the actual APIs or their requirements):
string trayapp = "c:\\[login to view URL]";
While(!ServiceIsStopping)
{
? ? interactiveSession[] sessions = enumerateInteractiveWindowsSessions();
? ? Foreach(interactiveSession s in sessions)
? {
? ? ? ? if(![login to view URL](trayapp)) // if tray application is not running in session
? ? ? ? ? ? ? ? Spawn(trayapp,? s); // spawn the tray application in session s
? }
? [login to view URL](1000); // Pause one second between checks
}
I did find a program at? <[login to view URL]>? that enumerates sessions (including interactive ones), but I have not found anything yet that allows a service to spawn an interactive application within a specific session, so coding this is probably the bulk of the challenge.
## Deliverables
C# executable to run in Windows 2000, XP, 2003, Vista, 2008; and compiled in Visual Studio 2005 or 2008.