title: Can DPI scaling be enabled/disabled programmatically on a per-session basis?
body: <p>My application happens to be written in Python using pygame, which wraps SDL, but I'm imagining that this is <em>probably</em> a more-general question to do with the Windows API.</p>
  
  <p>In some of my Python applications, I want pixel-for-pixel control under Windows 10 even at high resolutions.  I want to be able to ensure, for example, that if my Surface Pro 3 has a native resolution of 2160x1440, then I can enter full-screen mode with those dimensions and present a full-screen image of exactly those dimensions.</p>
  
  <p>The barrier to this is "DPI scaling".  By default, under Windows' Settings -> Display, the value of "Change the size of text, apps, and other items"  is "150% (Recommended)" and the result is that I only see 2/3 of my image.  I have discovered how to fix this behaviour...</p>
  
  <ol>
  <li>systemwide, by moving that slider down to 100% (but that's <a href="https://i.imgur.com/HFO5Rz8.png" rel="noreferrer">undesirable</a> for most other applications)</li>
  <li>just for <code>python.exe</code> and <code>pythonw.exe</code>, by going to those executables' "Properties" dialogs, Compatibility tab, and clicking "Disable display scaling on high DPI settings".  I can do this for me alone, or for all users.  I can also automate this process by setting the appropriate keys in the registry programmatically. Or via <code>.exe.manifest</code> files (which also seems to require a global setting change, to prefer external manifests, with possible side-effects on other applications).</li>
  </ol>
  
  <p>My question is: can I do this from <em>inside</em> my program on a per-launch basis, before I open my graphics window?  I, or anyone using my software, won't necessarily want this setting enabled for <em>all</em> Python applications ever—we might want it just when running particular Python programs.  I'm imagining there might be a <code>winapi</code> call (or failing that something inside SDL, wrapped by pygame) that could achieve this, but so far my research is drawing a blank.</p>