Return the effective DPI for the monitor the button control is currently displayed on.
C
int SftButton_GetDPI(HWND hwndCtl);
C++
int CSftButton::GetDPI() const;
hwndCtl
The window handle of the button control.
The current effective DPI: 96 at 100%, 120 at 125%, 144 at 150%, 192 at 200%.
GetDPI is the button's view of the monitor DPI - equivalent to GetDpiForWindow(hwndCtl) but returning the value the button currently uses for internal layout. The two agree in a PMv2-aware process.
Applications that perform their own pixel-level layout around the button should call GetDPI rather than caching a DPI from creation time, and re-read it on every SFTBUTTONN_DPI_CHANGED.
See Also Per-Monitor DPI and Scaling