title: How to get answer from windows service
body: <p>I´ve got a windows service and a NotifyIcon-Applicaiton (Sys-Tray) which should communicate with the service. The App should send a command and receive a PORT from the service for a socket which provides the further communication.</p>
  
  <p>The Service overrides the OnCustomCommand Method but I don´t know how to send an answer to the calling-programm.</p>
  
  <pre><code>    protected override void OnCustomCommand(int command)
      {
          switch (command)
          {
              case 'p':
                  // SEND Port number
                  break;
              case 's':
                  // SEND Service Name
                  break;
              case 'n':
                  // SEND Notification
                  break;
          }
  
          base.OnCustomCommand(command);
      }
  </code></pre>
  
  <p>Notify-Icon-Application</p>
  
  <p><code>var serviceController = new ServiceController("ATLED Service");
  serviceController.ExecuteCommand((int)'p');</code></p>