473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Windows Service & NotifyIcon

I have a NotifyIcon in my Windows Service project and I am trying to

add a ContextMenu to this NotifyIcon or use some of the mouse events.
Everything isn't working. I think so base class of the service
System.ServiceProcess.ServiceBase don't catchWindows messages like mouse or
timer messages. Any Idea?
Thanks,

Artur Kowalski

Nov 15 '05 #1
1 5628
MSDN:
"
a.. Windows Service applications run in a different window station than the
interactive station of the logged-on user. A window station is a secure
object that contains a clipboard, a set of global atoms, and a group of
desktop objects. Because the station of the Windows Service is not an
interactive station, dialog boxes raised from within a Windows Service
application will not be seen and may cause your program to stop responding.
Similarly, error messages should be logged in the Windows event log rather
than raised in the user interface.
The Windows Service classes supported by the .NET Framework do not support
interaction with interactive stations, that is, the logged-on user. The .NET
Framework also does not include classes that represent stations and
desktops. If your Windows Service must interact with other stations, you
will need to access the unmanaged Windows API.

The interaction of the Windows Service with the user or other stations must
be carefully designed to include scenarios such as there being no logged on
user, or the user having an unexpected set of desktop objects. In some
cases, it may be more appropriate to write a Windows application that runs
under the control of the user.

"

So:
1. Why a service? The service is supposed to be a completely automatic piece
of code that services clients. It wrotes events in event log and is
started/stopped via service manager. If you need user interaction why didn't
you design a simple Windows application?
2. Anyhow, if you want to manage the service locally/remotely via a
customised UI, and to issue more than start/stop functionality you have to
find a common repository (message queues, files or whatever) for the
messages send by a Windows app (the UI) that produces requests for the
service, and the service that consumes them.

--
Horatiu Ripa
"Artur Kowalski" <ar******@bsb.pl> wrote in message
news:bl**********@atlantis.news.tpi.pl...
I have a NotifyIcon in my Windows Service project and I am trying to

add a ContextMenu to this NotifyIcon or use some of the mouse events.
Everything isn't working. I think so base class of the service
System.ServiceProcess.ServiceBase don't catchWindows messages like mouse or timer messages. Any Idea?
Thanks,

Artur Kowalski

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Y | last post by:
I have a Windows Service created in VB.NET and I'm trying to implement a taskbar icon. I tried using NotifyIcon, but I can only get this to work on a Windows Form. In the Windows Service it...
7
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
2
by: Andrew Mueller | last post by:
Hello all, I have created a windows service and now I would like to have a configuration page in the system tray. Basically an icon I can click on which will just interact with an XML file. ...
11
by: Andrew Mueller | last post by:
Hello, Is there any way to make a form part of a windows service application and launch it upon double-click of a system tray icon? I already have the NotifyIcon working and have added an...
3
by: Seymen Ertas | last post by:
Hey anyone seen this before ? I followed examples from microsoft and added a notifyicon to my windows service project and i can't get the icon to show up. Here is a checklist of what i have...
1
by: chinimimita.hernandez | last post by:
Does anyone know how windows service work with notifyicon and contextmenu? I was able to run the windows service with notifyicon part but when I inserted the contextmenu command it didn't work....
0
by: Neo | last post by:
I have created a Windows Service that shows a notifyicon in the system tray. I have also created a context menu for the notifyicon and implemented the notifyicons click event. The notifyicon...
1
by: Jacek Jurkowski | last post by:
I would like to make a notyfication icon showing all the time my service is running ... The problem is that in implementation above requires to check "Allow interact with desktop" in service...
5
by: sonali_reddy123 | last post by:
Hello all, I am trying to develop an application which will run as a windows service. The application should have Normal options available with service like start, stop and pause but along...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.