1
Answer

MainWindowTitle returns empty used in c# Windows Service

Austin Muts

Austin Muts

6y
3.2k
1
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)