High DPI scaling, mouse hooks and WindowFromPoint
<p>I have a process that sets a <code>SetWindowsHookEx(WH_MOUSE_LL, , ,)</code> right click hook.  My process is set to DPI system aware on Window 10.0.10586 at 150% scaling on both monitors.  This was set by calling <code>SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)</code>.</p>
<p>My problem scenario is e.g. Office 2007 is DPI unaware, so let's place MS Word on the right quarter of the screen.  Right click just above the task bar in the bottom right and the mouse hook sends coordinates of 1279, 675 - scaled to Word.  Then I right click on visual studio (DPI aware), nearly three quarters across the screen and the mouse hook sends me coordinates of e.g. 1279, 1008 from Visual Studio.  So if I clicked higher up the screen I would potentially get the same 1279, 675.</p>
<p>My process is trying to determine which window is at the point by calling the <code>WindowFromPoint</code> API, but this will clearly fail in this scenario as two applications &quot;share&quot; the same point.</p>
<p>Is it possible to force the mouse hook to always send raw physical coordinates instead of those scaled to the DPI unaware application? and if so, how?  Alternately, is there some other way of determining the <code>hWnd</code> or <code>processID</code> from the mouse hooks?</p>