So it looks like the wscreen and hscreen are already scaled for font size - it is rcTray.top or rcTray.left that needs to be scaled.
Close, I think we're on the same page now, but the rcTray RECT structure is generated by a query to the system for where the Taskbar window is actually at. Hence it need not be scaled as it's an actual location. 21 isn't important because it just a decorative gap to keep the dialog slightly away from neighboring edges.
The issue, I believe, is in the x & y "measurements" because they're based in the physical pixel resolution which in your case (IIRC) is 2560 x 1600. At the default 96 DPI the physical & logical pixel dimensions match. When the DPI is increased the logical pixel count also increases, but the physical pixel count (can't) doesn't. The x & y values are from GetSystemMetrics(...) which only measures the (current resolution) physical pixel dimensions and throws off the calculations by the logical pixel difference.
Here's an interesting bit. I compiled a test copy with this code:
wscreen = MulDiv(iW, GetDeviceCaps(hdc, LOGPIXELSY), 144 /*GetDpiX()*/);
hscreen = MulDiv(iH, GetDeviceCaps(hdc, LOGPIXELSY), 144 /*GetDpiY()*/);
On XP @ 144DPI the dialog position is perfect.
On Win 7 @ 96DPI the dialog y (height) is correct, but the w is (almost perfectly) in the middle of the screen.
On Vista @ 144DPI perfect, at 96DPI same odd behavior as 7.
[Download removed to save space and avoid confusion - SJ]<-Let me know if this works for you @ 144DPI also)
If I can ever get the GetDpi() functions to cooperate (compile) we should have this thing licked.