title: What's the correct way to retrieve the DPI of secondary monitors?
body: <p><strong>Problem</strong><br/>
  On windows 8.1 (and newer) the DPI setting is per-monitor. I can clearly see in the system settings that my primary display (laptop) is set to 125% dpi, and my alternate display is set to 100% dpi. My application is written entirely in C#, and every API call I've tried results in the incorrect DPI for the secondary monitor. Keep in mind, that I am calling this method in the initialization of my process and have specified DPI aware in my manifest:</p>
  
  <pre><code>(shcore.dll)
  SetProcessDpiAwareness(PROCESS_DPI_AWARENESS::PROCESS_PER_MONITOR_DPI_AWARE);
  </code></pre>
  
  <p><strong>Attempts</strong></p>
  
  <pre><code>(shcore.dll) 
  GetDpiForMonitor(hMonitor, MONITOR_DPI_TYPE::MDT_EFFECTIVE_DPI, &amp;dpiX, &amp;dpiY)
  </code></pre>
  
  <p>(result 120 regardless of hMonitor handle)</p>
  
  <pre><code>(user32.dll)
  IntPtr dC = CreateDC(...);
  double logX = (double)GetDeviceCaps(dC, LOGPIXELSX);
  double logY = (double)GetDeviceCaps(dC, LOGPIXELSY);
  </code></pre>
  
  <p>(result 120 regardless of device name for CreateDC)</p>
  
  <p><strong>Monitor Layout</strong><br/>
  One other thing that seriously confuses me, is that the first monitor is at rect <code>{0,0,1920,1080}</code> but the second monitor is at <code>{2400,0,2400,1350}</code>, which essentially makes a actual desktop size of <code>{4800x1350}</code> and a virtual desktop size of <code>{3840x1080}</code>, but there is missing pixels between the monitors that I can't account for and I don't understand.</p>
  
  <pre><code>                 Screen 1    Screen 2
  Actual Pixels:   1920x1080   2400x1350
  Virtual Pixels:  1536x864    1920x1080
  Top-Left Coord:  0x0         2400x0
  Actual DPI:      120 (125%)   96 (100%)
  Returned DPI:    120 (125%)  120 (125%)
  </code></pre>
  
  <p>Another way that I can confirm that the displays are different DPI, is dragging the center point of any DPI aware application across the boundary between monitors will cause the window to change it's size to be consistent across the displays (WPF does this by default).</p>