简体   繁体   中英

Detect OS text size on win7

I would like to detect (via c++) what the user has chosen for text size, ie:

Smaller - 100% Medium - 125% Larger - 150%

Seems like an easy one, just can't seem to find the answer....

thanks, A

MSDN has a comprehensive reference on DPI awareness, although it's rather long. The correct function is GetDeviceCaps, using LOGPIXELSX and LOGPIXELSY to determine the DPI in each dimension. (These are not guaranteed to be the same.) Documentation for GetDeviceCaps is here .

This changes the DPI for the DISPLAY device. Use GetDeviceCaps(), LOGPIXELSX/Y. Use CreateIC(L"DISPLAY", 0, 0, 0) to create the DC. The percentage value corresponds to 96, 120 and 144 dots-per-inch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM