win: use same code style

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-11-06 16:04:34 +08:00
parent 2a24f72cea
commit 32d29e39f6
1 changed files with 4 additions and 5 deletions

View File

@ -2378,13 +2378,12 @@ DpiAwareness Utils::getDpiAwarenessForCurrentProcess(bool *highest)
} }
if (API_USER_AVAILABLE(IsProcessDPIAware)) { if (API_USER_AVAILABLE(IsProcessDPIAware)) {
const BOOL isAware = API_CALL_FUNCTION(IsProcessDPIAware); const BOOL isAware = API_CALL_FUNCTION(IsProcessDPIAware);
static constexpr const auto highestAvailable = DpiAwareness::System;
const auto result = ((isAware == FALSE) ? DpiAwareness::Unaware : DpiAwareness::System);
if (highest) { if (highest) {
*highest = (isAware != FALSE); *highest = (result == highestAvailable);
} }
if (isAware) { return result;
return DpiAwareness::System;
}
return DpiAwareness::Unaware;
} }
return DpiAwareness::Unknown; return DpiAwareness::Unknown;
} }