Windows service - context menu doesn't work

m7j4p7

Regular
Joined
Nov 16, 2003
Messages
54
Hi,

I have a windows service which will run automatically in the background, and have placed a notify icon in the service, which has a context menu assigned to it.

However, when I run the service, and left-click on the icon, no context menu shows - the service is running under 'Local System' and I have given it full .NET trust...

Does anyone have any ideas why this is happening?

Thanks.
 
Just to get some facts right...
You have a windows service that runs in the background, and have a notify icon assigned to it... Is the notify icon compiled into the service, or is it another application that talks to the service.

Remember that windows services do not interact well with forms or the desktop in a UI sence. To use a notify icon you need to have two programs. One is the service and the other is the moneitoring app. Then you need to work out a way for them to talk together (I would recomend using remoting). Then you would process events on the two apps that would publish to the other through the remoting system. This is how the service controller for SQL and MSDE Work.

m7j4p7 said:
Hi,

I have a windows service which will run automatically in the background, and have placed a notify icon in the service, which has a context menu assigned to it.

However, when I run the service, and left-click on the icon, no context menu shows - the service is running under 'Local System' and I have given it full .NET trust...

Does anyone have any ideas why this is happening?

Thanks.

Jus
 
Thanks a lot - I'll look into remoting.

I'm a programmer who has just recently migrated to .NET, and so it could take me a while to finish this project!!
 
Back
Top