can't detect windows arise distance altered c++ mfc
i'm perplexing establish i detect user changes windows arise distance normal additional infinite fonts, arise distance comparison executing following stairs windows xp machine:
- right-click desktop name properties.
- click coming tab.
- select arise size: normal/large fonts/extra infinite fonts
my bargain arise distance change law dpi change, here i've attempted far.
my goal:
i wish detect windows arise size altered normal infinite additional infinite fonts take actions formed arise distance change. i assume windows arise distance changes, dpi also change (especially distance additional infinite fonts
what i've attempted far:
i accept several messages including: wm_settingchange, wm_nccalcsize, wm_ncpaint, etc... nonetheless zero messages unparalleled conditions arise distance changes, words, i accept wm_settingschange summary i wish know changed.
in speculation i interpretation onsettingchange windows calls it, lpszsection should tell me changing domain is, works fine, nonetheless following i check given domain job systemparametersinfo i pass movement spi_getnonclientmetrics, i step by debugger i certain i watch information returned nonclientmetrics any arise changes, nonetheless zero occur.
even didn't work, i should still means check dpi settings change. i unequivocally wouldn't caring details, each i wm_settingchange message, i only check dpi perform actions i'm prying performing, nonetheless i'm means component dpi either.
i have attempted dpi invoking slight getsystemmetrics, also any dc:
dekstop dc->getdevicecaps logpixelsx/logpixelsy
window dc->getdevicecaps logpixelsx/logpixelsy
current dc->getdevicecaps logpixelsx/logpixelsy
even i change dpi distinguished properties window values don't relapse anything different, always arrangement 96.
could anybody assistance me figure out please? should i looking for? where should i looking at?
afx_msg vacant cmainframe::onsettingchange(uint uflags, lpctstr lpszsection)
{
int windowdpi = 0;
int devicedpi = 0;
int systemdpi = 0;
int desktopdpi = 0;
int dpi_00_x = 0;
int dpi_01_x = 0;
int dpi_02_x = 0;
int dpi_03_x = 0;
cdc* windowdc = cwnd::getwindowdc(); // try window dc
hdc desktop = ::getdc(null); // try desktop dc
cdc* device = cwnd::getdc(); // try tide dc
hdc hdc = *device; // try hdc
if( windowdc )
{
windowdpi = windowdc->getdevicecaps(logpixelsy);
// always 96 regardless i change arise
// distance additional infinite fonts keep during normal
dpi_00_x = windowdc->getdevicecaps(logpixelsx); // 96
}
if( desktop )
{
desktopdpi = ::getdevicecaps(desktop, logpixelsy); // 96
dpi_01_x = ::getdevicecaps(desktop, logpixelsx); // 96
}
if( device )
{
devicedpi = device->getdevicecaps(logpixelsy); // 96
dpi_02_x = device->getdevicecaps(logpixelsx); // 96
}
systemdpi = ::getdevicecaps(hdc, logpixelsy); // 96
dpi_03_x = ::getdevicecaps(hdc, logpixelsx); // 96
cwnd::releasedc(device);
cwnd::releasedc(windowdc);
::releasedc(null, desktop);
::releasedc(null, hdc);
cwnd::onwinsettingchange(uflags, lpszsection);
}
the dpi always advantage 96, nonetheless settings changes take outcome i change arise distance additional infinite fonts i change dpi 120 (from graphics properties).
Comments
Post a Comment