BCGSuite for MFC
CRect CBCGPGlobalUtils::ScaleByDPI ( CRect  rect,
const CWnd *  pWnd = NULL,
BOOL  bKeepCenter = FALSE 
)

Returns the rectangle scaled by the DPI (Dots Per Pixel) of the specified window.

Parameters
rectThe rectangle to be scaled.
pWndThe pointer to the CWnd object. If this parameter is a CWnd::wndTop address, the active (currently drawn) window will be used.
bKeepCenterSpecifies whether the returned rectangle center is the same as the source rectangle center point.
Returns
The scaled rectangle.