Fully implement the tabbing and switching
This commit is contained in:
@@ -27,12 +27,14 @@ internal static class Program {
|
||||
private static void AdjustAffinities() {
|
||||
for (int i = 0; i < NumProc; i++) {
|
||||
var window = windows[i];
|
||||
if (window == null) continue;
|
||||
if (window.MainWindowHandle == IntPtr.Zero) {
|
||||
Console.WriteLine($"Window at index {i} has no main window, removing from tracked windows");
|
||||
windows[i] = null;
|
||||
continue;
|
||||
}
|
||||
if (window != null && i != ActiveIndex) {
|
||||
|
||||
if (i != ActiveIndex) {
|
||||
try {
|
||||
window.ProcessorAffinity = defaultAffinity;
|
||||
}
|
||||
@@ -56,12 +58,14 @@ internal static class Program {
|
||||
private static void AdjustPriorities() {
|
||||
for (int i = 0; i < NumProc; i++) {
|
||||
var window = windows[i];
|
||||
if (window == null) continue;
|
||||
if (window.MainWindowHandle == IntPtr.Zero) {
|
||||
Console.WriteLine($"Window at index {i} has no main window, removing from tracked windows");
|
||||
windows[i] = null;
|
||||
continue;
|
||||
}
|
||||
if (window != null && i != ActiveIndex) {
|
||||
|
||||
if (i != ActiveIndex) {
|
||||
try {
|
||||
window.PriorityClass = ProcessPriorityClass.Idle;
|
||||
}
|
||||
@@ -70,7 +74,7 @@ internal static class Program {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var active = windows[ActiveIndex];
|
||||
if (active != null) {
|
||||
try {
|
||||
@@ -173,10 +177,10 @@ internal static class Program {
|
||||
AdjustPriorities();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[STAThread]
|
||||
private static void Main() {
|
||||
AllocConsole();
|
||||
//AllocConsole();
|
||||
|
||||
var processes = Process.GetProcesses();
|
||||
var currentProcess = Process.GetCurrentProcess();
|
||||
@@ -188,16 +192,12 @@ internal static class Program {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
windows.Add(null);
|
||||
windows[i] = null;
|
||||
HotKeyManager.RegisterHotKey(Keys.D1 + i, KeyModifiers.Alt);
|
||||
HotKeyManager.RegisterHotKey(Keys.D1 + i, KeyModifiers.Alt | KeyModifiers.Shift);
|
||||
}
|
||||
|
||||
HotKeyManager.RegisterHotKey(Keys.Oemtilde, KeyModifiers.Alt);
|
||||
|
||||
// HotKeyManager.RegisterHotKey(Keys.Q, KeyModifiers.Alt);
|
||||
// HotKeyManager.RegisterHotKey(Keys.W, KeyModifiers.Alt);
|
||||
// HotKeyManager.RegisterHotKey(Keys.R, KeyModifiers.Alt);
|
||||
HotKeyManager.HotKeyPressed += HotKeyManager_HotKeyPressed;
|
||||
|
||||
static void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e) {
|
||||
|
Reference in New Issue
Block a user