Cache process main window handle
* process tree list
*
* Copyright (C) 2010-2016 wj32
- * Copyright (C) 2016-2021 dmex
+ * Copyright (C) 2016-2022 dmex
* Copyright (C) 2021 jxy-s
*
* This file is part of Process Hacker.
@@ -912,11 +912,14 @@ static VOID PhpUpdateProcessNodeWindow(
PhClearReference(&ProcessNode->WindowText);
if (ProcessNode->ProcessItem->QueryHandle && !ProcessNode->ProcessItem->IsSubsystemProcess)
+ {
+ if (!ProcessNode->WindowHandle)
{
ProcessNode->WindowHandle = PhGetProcessMainWindow(
ProcessNode->ProcessId,
ProcessNode->ProcessItem->QueryHandle
);
+ }
if (ProcessNode->WindowHandle)
{
