1

I have 2 Windows services written on .NET 4.5.1. I am looking to see if there is functionality like WinAPI's SendMessage(IntPtr hwnd, uint Msg, IntPtr wParam, IntPtr lParam) call that i can use for a GUI-less process like a windows service!

Thanks!

grmartin
  • 1,399
  • 2
  • 12
  • 23
  • possible duplicate of [Send windows message to a Windows Service](http://stackoverflow.com/questions/1233195/send-windows-message-to-a-windows-service) – Gusman Apr 25 '14 at 13:15

2 Answers2

1

You can use Named pipes. See here: http://msdn.microsoft.com/en-us/library/system.io.pipes(v=vs.110).aspx for more details.

Nick
  • 4,787
  • 2
  • 18
  • 24
1

When two processes need to communicate, they do so using one of any number of inter-process communication (IPC) mechanisms. The answers to this SO post give you a few ideas of the possibilities. To this I would add WCF, which is the Microsoft-recommended way of having two .NET-based applications talk to one another.

Personally, I choose sockets for this kind of thing, but it really does come down to your particular situation and your comfort level.

HTH

Community
  • 1
  • 1
Matt Davis
  • 45,297
  • 16
  • 93
  • 124