From 6a4e25cdb8477e5189a24c5ef9f1ace6f9ec4181 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 3 Jan 2025 19:51:28 +0100 Subject: [PATCH] Make more processes --- DD2Switcher/Program.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DD2Switcher/Program.cs b/DD2Switcher/Program.cs index d040f81..fed682b 100644 --- a/DD2Switcher/Program.cs +++ b/DD2Switcher/Program.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; namespace DD2Switcher; internal static class Program { - private static int NumProc = 9; + private static int NumProc = 10; private static Process[] windows = new Process[NumProc]; private static int ActiveIndex = -1; @@ -142,7 +142,7 @@ internal static class Program { Console.WriteLine($"Foreground process: {process}"); bool found = false; - for (int i = 0; i < 9; i++) { + for (int i = 0; i < NumProc; i++) { var window = windows[i]; if (window != null && window.Id == process.Id) { found = true; @@ -151,7 +151,7 @@ internal static class Program { } if (!found) { - for (int i = 0; i < 9; i++) { + for (int i = 0; i < NumProc; i++) { var window = windows[i]; if (window == null) { Console.WriteLine($"Adding foreground window to tracked at index {i}..."); @@ -160,7 +160,7 @@ internal static class Program { } } - for (int i = 0; i < 9; i++) { + for (int i = 0; i < NumProc; i++) { var window = windows[i]; if (window != null && window.Id == process.Id) { windows[i] = windows[index]; @@ -201,7 +201,7 @@ internal static class Program { Process.GetCurrentProcess().Kill(); } - for (int i = 0; i < 9; i++) { + for (int i = 0; i < NumProc; i++) { windows[i] = null; HotKeyManager.RegisterHotKey(Keys.D1 + i, KeyModifiers.Alt); HotKeyManager.RegisterHotKey(Keys.D1 + i, KeyModifiers.Alt | KeyModifiers.Shift);