HeaderPane
Main
Hide

SftTabs/DLL 7.0 Documentation

Share Link
Print

PixelScaling

Defines how caller-supplied pixel dimensions (margins, forced tab size, etc.) are interpreted relative to the current monitor DPI.

C

void WINAPI SftTabs_SetPixelScaling(HWND hwndCtl, int mode);
int WINAPI SftTabs_GetPixelScaling(HWND hwndCtl);

C++

void CSftTabs::SetPixelScaling(int mode);
int CSftTabs::GetPixelScaling() const;

Parameters

hwndCtl

The window handle of the tab control.

mode

Defines the pixel scaling mode. mode can be one of the following values:

SFTTABS_PIXELSCALING_ASISCaller-supplied pixel dimensions are used verbatim, in physical screen pixels. This is the default and preserves the traditional SftTabs/DLL behavior. A margin of 10 is 10 screen pixels on any monitor.
SFTTABS_PIXELSCALING_STRETCHCaller-supplied pixel dimensions are interpreted as 96-DPI reference pixels and are scaled by the factor currentDPI / 96 each time they are used. A margin of 10 set on a 96-DPI monitor is 10 screen pixels at 100%, 15 pixels at 150%, 20 pixels at 200%. Storage and the corresponding Get* functions always return the value in caller-reference (96-DPI) units.

Returns

GetPixelScaling returns a value indicating the current pixel scaling mode (SFTTABS_PIXELSCALING_ASIS or SFTTABS_PIXELSCALING_STRETCH).

Comments

The SetPixelScaling and GetPixelScaling functions define how caller-supplied pixel dimensions are interpreted relative to the current monitor DPI. The setting affects the following caller-supplied values on SFTTABS_CONTROL:

  • leftMargin and rightMargin (margin widths on the tab row),
  • rowIndent (row indentation),
  • forcedSize (forced tab row height / width).

SetPixelScaling is independent of SetImageScaling. SetPixelScaling controls how caller-supplied pixel dimensions are interpreted; SetImageScaling controls the size at which images are drawn. Either can be used without the other.

SFTTABS_PIXELSCALING_ASIS (the default) preserves back-compatible behavior. A margin of 10 set on a 96-DPI monitor is 10 pixels on any monitor - useful when the application is already DPI-aware and performs its own scaling, but means the margin appears physically smaller on high-DPI monitors.

SFTTABS_PIXELSCALING_STRETCH makes caller-supplied pixel values resolution-independent. Margins, indentation and forced tab sizes stay physically the same as the user moves between monitors of different DPI. Because storage and the corresponding Get* functions always return caller-reference units, serialized configurations remain portable between machines of different DPI and between different monitors of the same machine.

See Also C/C++ API | C++ Classes | Notifications


Last Updated 04/22/2026 - (email)
© 2026 Softel vdm, Inc.