HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

GetDPI

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;

Parameters

hwndCtl

The window handle of the button control.

Return Value

The current effective DPI: 96 at 100%, 120 at 125%, 144 at 150%, 192 at 200%.

Comments

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


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.