I have a Windows service that writes messages to the Event Log. I also have a form application that reads that Event Log and displays the messages. The Windows service has an event that it fires which sends 2 key pieces of information in its EventArgs that I would like to be able to access from my form. Is there a way for me to hook into the service from the form to listen for this event?
Asked
Active
Viewed 2,960 times
1 Answers
0
Is this something you are looking for
http://ashishware.com/websocksample.shtml
http://www.codeproject.com/Articles/4857/A-realtime-event-log-monitoring-tool

fenix2222
- 4,602
- 4
- 33
- 56
-
I have that part already setup and working. What I am looking for is a way for that application to listen for an event from a windows service, which in this case I happen to have made. – Zholen Jun 11 '12 at 23:06
-
@Zholen - Are you saying you want to monitor only events that come from Windows Service? Just filter it by EventLog Source and create custom EventLog source for event logs created by windows service. There wouldn't be any way of intercepting windows service event itself unless you expose a WCF service in your WinForms applicaiton that Windows service can access and notify WinForm app of any change – fenix2222 Jun 11 '12 at 23:09
-
I have that, but i want to access 2 values(or event) from the service which are not posted in the log. The service has an event that it fires with these values, i would like to be able to listen for that event from my form. – Zholen Jun 11 '12 at 23:15
-
@Zholen - You cannot really listen to WindowsService events, your windows service will have to notify your WinForms application of any events (you can use WCF to do that). ALternatively you could write these values into some temp file/folder that WinFors application can monitor for changes. – fenix2222 Jun 11 '12 at 23:18