title: SetProcessDPIAware seems not to work under windows 10
body: <p>I am trying to get the real screen resolution (in pixels) in a windows C++ app. When the windows dpi setting is changed, I get the virtual (adjusted) resolution instead of the real one. I have tried using SetProcessDPIAware, SetProcessDpiAwareness (with all three enumerated values as arguments) and a true setting in a manifest. In all three cases, the code works fine (i.e. shows the real resolution) in my windows 7 PC but not in a Win 10 one (here it ignores the DPI Aware setting and returns the adjusted resolution).</p>
  
  <pre><code>#define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
  
  // Windows Header Files:
  #include &lt;windows.h&gt;
  #include &lt;winuser.h&gt;
  #include &lt;VersionHelpers.h&gt;
  #include &lt;ShellScalingAPI.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  
  int APIENTRY WinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPSTR     lpCmdLine,
                       int       nCmdShow)
  {
  char *cBuffer2 ;
  
    cBuffer2 = (char *)malloc(3000) ;
    if (IsWindowsVistaOrGreater())
    {
  //    SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE);
        int result = SetProcessDPIAware();
  
        sprintf(cBuffer2,"SetProcessDPIAware() result: [%i]\n",result) ;
  
        int height = GetSystemMetrics(SM_CYSCREEN);
        int width = GetSystemMetrics(SM_CXSCREEN);
        sprintf(cBuffer2,"%s#1:\nHeight: [%i]\nwidth: [%i]\n",cBuffer2,height,width) ;
  
  
        HWND hwnd = (HWND)atoi(lpCmdLine) ;
        HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
        MONITORINFO info;
        info.cbSize = sizeof(MONITORINFO);
        GetMonitorInfo(monitor, &amp;info);
        int monitor_width = info.rcMonitor.right - info.rcMonitor.left;
        int monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
        sprintf(cBuffer2,"%s#2:\nHeight: [%i]\nwidth: [%i]\n",cBuffer2,monitor_height,monitor_width) ;
  
    }
  
    MessageBox(0,cBuffer2,"SHOWRES.EXE",MB_OK) ;
    return 0 ;
  }
  </code></pre>
  
  <p>The manifest I tried using is the following one:</p>
  
  <pre><code>&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" &gt;
    &lt;asmv3:application&gt;
      &lt;asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"&gt;
        &lt;dpiAware&gt;true&lt;/dpiAware&gt;
      &lt;/asmv3:windowsSettings&gt;
    &lt;/asmv3:application&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>Any ideas?</p>