We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87c60c8 commit ff4a8ddCopy full SHA for ff4a8dd
DigitalWellbeingWPF/App.xaml.cs
@@ -37,12 +37,11 @@ private void CheckAndShowCurrentApp()
37
{
38
Process thisProcess = Process.GetCurrentProcess();
39
40
- IEnumerable<Process> similarAppProcesses = Process.GetProcesses().Where(p => p.ProcessName == thisProcess.ProcessName);
+ IEnumerable<Process> similarAppProcesses = Process.GetProcesses().Where(
41
+ p => p.ProcessName == thisProcess.ProcessName && p.SessionId == thisProcess.SessionId);
42
43
if (similarAppProcesses.Count() > 1)
44
- //ShowMessage_AlreadyRunning();
45
-
46
try
47
48
IntPtr existingProcessHWnd = similarAppProcesses.Single(p => thisProcess.Id != p.Id).MainWindowHandle;
0 commit comments