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