Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Cannot see system tray icon

Cannot see system tray icon

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matsnas
    wrote on last edited by
    #1

    Hi! I have a created a windows service. Now I'm writing an application that monitors this service. I want the application to display a NotifyIcon in the system tray. Also I want the service to start the monitoring application if it's not already running. If I start the application on it's own everything works fine. I can see and intercat with my icon, but if the service starts the application I can see the process running in the Task Manager but the system tray icon is missing. Any ideas?

    D 1 Reply Last reply
    0
    • M matsnas

      Hi! I have a created a windows service. Now I'm writing an application that monitors this service. I want the application to display a NotifyIcon in the system tray. Also I want the service to start the monitoring application if it's not already running. If I start the application on it's own everything works fine. I can see and intercat with my icon, but if the service starts the application I can see the process running in the Task Manager but the system tray icon is missing. Any ideas?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      It's missing because the service started the monitoring application on the wrong desktop. Service run under their own desktop, not the one you see when you log in. You might want to try going into the Service manager, getting properties on your service, click the LogOn tab, and check the box that says something like "Allow service to interact with desktop". RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        It's missing because the service started the monitoring application on the wrong desktop. Service run under their own desktop, not the one you see when you log in. You might want to try going into the Service manager, getting properties on your service, click the LogOn tab, and check the box that says something like "Allow service to interact with desktop". RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        M Offline
        M Offline
        matsnas
        wrote on last edited by
        #3

        Yes, I guessed that it was something like that. When the service is starting the monitoring application they both run as SYSTEM in the task manager. I've tried to set it to allow interaction with my desktop, as you proposed, with no result. I also tried to allow the service to run as my user account. Now both the service and the monitoring application is running as my local user in the task manager but still no system tray icon?

        D 1 Reply Last reply
        0
        • M matsnas

          Yes, I guessed that it was something like that. When the service is starting the monitoring application they both run as SYSTEM in the task manager. I've tried to set it to allow interaction with my desktop, as you proposed, with no result. I also tried to allow the service to run as my user account. Now both the service and the monitoring application is running as my local user in the task manager but still no system tray icon?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I was afraid of that... The easier method is to not create the monitor process from the service. This is because the service will run without a user being logged in, and hence, there's no desktop to start the process on anyway. You can use .NET Remoting to get status information from your service. Start the manager application out of the Run key in the Registry. This will start the monitor whenever a user logs in. This monitor can then contact the service over Remoting and get status information and updates through events over Remoting. Then the monitor can put up the icon in the Tray without any desktop problems. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups