Merge upstream and add generic Codex notifications

This commit is contained in:
2026-08-04 15:16:36 +08:00
31 changed files with 374 additions and 218 deletions
+21
View File
@@ -63,6 +63,24 @@ internal static partial class ProcessTree
return "";
}
public static string FindWindowExePath(IntPtr hwnd)
{
if (hwnd == IntPtr.Zero)
{
return "";
}
try
{
GetWindowThreadProcessId(hwnd, out var pid);
return pid == 0 ? "" : GetFullPath(pid);
}
catch
{
return "";
}
}
private static Dictionary<uint, (uint Parent, string Name)> BuildParentMap()
{
var map = new Dictionary<uint, (uint, string)>();
@@ -128,6 +146,9 @@ internal static partial class ProcessTree
[LibraryImport("kernel32.dll")]
private static partial uint GetCurrentProcessId();
[LibraryImport("user32.dll")]
private static partial uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
[LibraryImport("kernel32.dll")]
private static partial IntPtr CreateToolhelp32Snapshot(uint dwFlags, uint th32ProcessID);