Output Formatting on Window Changed, and Z-Order

This commit is contained in:
glax 2024-04-17 00:11:24 +02:00
parent feb0e9b78a
commit 3588d8adaa
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ public class Blur
{
uint i = 0;
string print = $"Z-order changed\n{"Z",-3} | {"hWnd",-8} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n";
string print = $"Z-order changed\n{"Z",3} | {"hWnd",-10} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n";
foreach (IntPtr windowHandle in newOrder)
{
WindowInfo windowInfo = _windowManager.WindowInfos.FirstOrDefault(w => w.WindowHandle == windowHandle);
@ -186,7 +186,7 @@ public class Blur
private void WindowManagerOnWindowsChanged(WindowInfo[] before, WindowInfo[] after)
{
string print = $"Window changed\n{"hWnd",-8} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n";
string print = $"Window changed\n{"hWnd",-10} | {"PID",-8} | {"Name",-17} | {"Window Title",-17} | {"State",-13} | BBox\n";
foreach (WindowInfo windowInfo in after)
print += $"{windowInfo}\n";
_logger?.LogInformation(print);

View File

@ -45,6 +45,6 @@ public readonly struct WindowInfo
const int cutoffStr = 17;
string processNameStr = ProcessInfo.ProcessName.Substring(0, Math.Min(cutoffStr, ProcessInfo.ProcessName.Length));
string windowTitleStr = WindowTitle.Substring(0, Math.Min(cutoffStr, WindowTitle.Length));
return $"0x{WindowHandle,-6:X} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {WindowCommands,-13} | {WindowRectangle}";
return $"0x{WindowHandle,-8:X} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {WindowCommands,-13} | {WindowRectangle}";
}
}