Merge upstream and add generic Codex notifications
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user