BCGControlBar Pro for MFC
UINT CBCGPGlobalUtils::GetDpiForWindow ( const CWnd *  pWnd)

Returns the DPI (Dots Per Pixel) value for the specified window.

Parameters
pWndThe pointer to the CWnd object. If this parameter is a CWnd::wndTop address, the active (currently drawn) window will be used.