0

Currently, I call SetProcessDPIAware() but the docs recommend using a manifest:

We recommended that you specify the default process DPI awareness via a manifest setting. While specifying the default via API is supported, it is not recommended.

Additionally, I find that on some machines calling SetProcessDPIAware() causes the window title to disappear and reappear which causes the window to move down. I'm trying to have a persistent window position and this flicker is making my window slide down the screen after repeated runs.

How do I set dpi settings in the manifest in Visual Studio? How would I make premake generate a vcxproj with that setting?

How to run correctly with a high DPI setting? describes some of the answer I'm looking for, but the menus are different for C#.

idbrii
  • 10,975
  • 5
  • 66
  • 107
  • 1
    "*on some machines calling `SetProcessDPIAware()` causes the window title to disappear and reappear which causes the window to move down*" - you are supposed to call `SetProcessDPIAware()` **before** creating any GUI windows. – Remy Lebeau Aug 25 '21 at 00:22

1 Answers1

0

To change in Visual Studio:

  1. Open properties for the Startup Project
  2. Manifest Tool > Input and Output
  3. Change DPI Awareness to Per Monitor High DPI Aware

To change in premake, set dpiawareness inside your project block:

project( "ProjectName" )
    kind "WindowedApp"

    dpiawareness "HighPerMonitor"
idbrii
  • 10,975
  • 5
  • 66
  • 107