Fix GetWindowPlacement warning
@@ -662,14 +662,16 @@ VOID PhMwpInitializeProcessMenu(
// Window menu
if (NumberOfProcesses == 1)
{
- WINDOWPLACEMENT placement = { sizeof(placement) };
-
// Get a handle to the process' top-level window (if any).
PhMwpSelectedProcessWindowHandle = PhGetProcessMainWindow(Processes[0]->ProcessId, Processes[0]->QueryHandle);
if (!PhMwpSelectedProcessWindowHandle)
item->Flags |= PH_EMENU_DISABLED;
+ if (PhMwpSelectedProcessWindowHandle)
+ {
+ WINDOWPLACEMENT placement = { sizeof(placement) };
+
GetWindowPlacement(PhMwpSelectedProcessWindowHandle, &placement);
if (placement.showCmd == SW_MINIMIZE)
@@ -679,6 +681,7 @@ VOID PhMwpInitializeProcessMenu(
else if (placement.showCmd == SW_NORMAL)
PhEnableEMenuItem(item, ID_WINDOW_RESTORE, FALSE);
}
+ }
else
{
item->Flags |= PH_EMENU_DISABLED;
