locked
Determine when I can load a system tray icon from a Service RRS feed

  • Question

  • Greetings!

    I would like to have the following application model:

    1. A service that starts whent the computer starts (Got this... do it a lot)
    2. Some way for the service to determine when someone has logged in. (No clue here... check to see if explorer.exe is running?)
    3. When 2 is true, load a system tray icon. (I can do this in a Windows Forms application but not a service... no system tray, you see ;P )
    4. Let the user interact with the system tray icon to display a form, start/restart the service, etc. (Again, not difficult)

    Where I'm stumped is #2. Basicly I want the service to do its business, periodically checking to see if someone has logged in (Or perhaps it responds to some unknown "login" event? Does such a thing exist?) and then displays the system tray icon which would then allow the other interactivity I'm after.

    I've seen a few threads here about creating two seperate applications (the service then the Winforms app) that talk to eachother, but I would really like to keep this in one app if possible.

    Thanks in advance!

    Thursday, May 24, 2012 5:34 PM

Answers

  • Nevermind. This is a Windows 7 App and I've been advised there's no way around the Session 0 limitation that prevents services from interacting with the UI.

    So a second application it is!

    • Marked as answer by FirstYearDeek Thursday, May 24, 2012 5:38 PM
    Thursday, May 24, 2012 5:38 PM

All replies

  • Nevermind. This is a Windows 7 App and I've been advised there's no way around the Session 0 limitation that prevents services from interacting with the UI.

    So a second application it is!

    • Marked as answer by FirstYearDeek Thursday, May 24, 2012 5:38 PM
    Thursday, May 24, 2012 5:38 PM
  • Hi FirstYearDeek,

    I'm glad you solved the issue.

    Have a nice day.


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 28, 2012 1:35 AM