[FancyZones] Do not restore maximized windows (#5597)

* Do not restore maximized windows

* Fix show command comparison

* Move maximized check outside of RestoreWindowSize function
This commit is contained in:
vldmr11080
2020-08-06 15:12:49 +02:00
committed by GitHub
parent 9b4574ad06
commit 6c4129d02a
3 changed files with 13 additions and 1 deletions

View File

@@ -177,6 +177,17 @@ bool IsInterestingWindow(HWND window, const std::vector<std::wstring>& excludedA
return true;
}
bool IsWindowMaximized(HWND window) noexcept
{
WINDOWPLACEMENT placement{};
if (GetWindowPlacement(window, &placement) &&
placement.showCmd == SW_SHOWMAXIMIZED)
{
return true;
}
return false;
}
void SaveWindowSizeAndOrigin(HWND window) noexcept
{
HANDLE handle = GetPropW(window, RESTORE_SIZE_STAMP);