registerHighDPISupport function

void registerHighDPISupport()

Registers a traditional Win32 app process as supporting high-DPI.

Reduces blurriness but requires the app to provide necessary DPI awareness.

Implementation

void registerHighDPISupport() {
  final result =
      SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
  if (result == FALSE) {
    final debugMessage = 'WARNING: could not set DPI awareness'.toNativeUtf16();
    OutputDebugString(debugMessage);
    free(debugMessage);
  }
}