Austin Muts

Austin Muts

  • 1.4k
  • 329
  • 125.2k

MainWindowTitle returns empty used in c# Windows Service

Aug 28 2018 11:47 AM
I have a C# windows service and want to display applications running on a computer .
The code "var process  = Process.GetProcesses().Where(p => !string.IsNullorEmpty(p.MainWindowTitle)).ToList()" returns an empty string when i change console application to windows service but shows data if it is running as a console application. May you please help as i want this code to return string running as windows service as it does when i am running as a console application.

Answers (1)