impr: Moved Windows DPI awareness to manifest file, added detached console allocation

Closes #1543
This commit is contained in:
WerWolv
2024-12-28 23:47:42 +01:00
parent f79de6fbe8
commit 6a5473f6fe
3 changed files with 11 additions and 16 deletions

View File

@@ -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