impr: Moved Windows DPI awareness to manifest file, added detached console allocation
Closes #1543
This commit is contained in:
parent
f79de6fbe8
commit
6a5473f6fe
@ -397,22 +397,6 @@ namespace hex {
|
||||
|
||||
|
||||
void Window::initNative() {
|
||||
// Setup DPI Awareness
|
||||
{
|
||||
using SetProcessDpiAwarenessContextFunc = HRESULT(WINAPI *)(DPI_AWARENESS_CONTEXT);
|
||||
|
||||
SetProcessDpiAwarenessContextFunc setProcessDpiAwarenessContext =
|
||||
reinterpret_cast<SetProcessDpiAwarenessContextFunc>(
|
||||
reinterpret_cast<void*>(
|
||||
GetProcAddress(GetModuleHandleW(L"user32.dll"), "SetProcessDpiAwarenessContext")
|
||||
)
|
||||
);
|
||||
|
||||
if (setProcessDpiAwarenessContext != nullptr) {
|
||||
setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImHexApi::System::isDebugBuild()) {
|
||||
// If the application is running in debug mode, ImHex runs under the CONSOLE subsystem,
|
||||
// so we don't need to do anything besides enabling ANSI colors
|
||||
|
10
resources/dist/windows/imhex.manifest
vendored
Normal file
10
resources/dist/windows/imhex.manifest
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
<consoleAllocationPolicy xmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
@ -1,6 +1,7 @@
|
||||
#pragma code_page(65001)
|
||||
|
||||
GLFW_ICON ICON dist/windows/icon.ico
|
||||
1 24 "dist/windows/imhex.manifest"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION PROJECT_VERSION_MAJOR,PROJECT_VERSION_MINOR,PROJECT_VERSION_PATCH
|
||||
|
Loading…
x
Reference in New Issue
Block a user