Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 70953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:48:42+00:00 2026-05-10T19:48:42+00:00

I’m trying to determine how I can detect when the user changes the Windows

  • 0

I’m trying to determine how I can detect when the user changes the Windows Font Size from Normal to Extra Large Fonts, the font size is selected by executing the following steps on a Windows XP machine:

  1. Right-click on the desktop and select Properties.
  2. Click on the Appearance Tab.
  3. Select the Font Size: Normal/Large Fonts/Extra Large Fonts

My understanding is that the font size change results in a DPI change, so here is what I’ve tried so far.


My Goal:

I want to detect when the Windows Font Size has changed from Normal to Large or Extra Large Fonts and take some actions based on that font size change. I assume that when the Windows Font Size changes, the DPI will also change (especially when the size is Extra Large Fonts


What I’ve tried so far:

I receive several messages including: WM_SETTINGCHANGE, WM_NCCALCSIZE, WM_NCPAINT, etc… but none of these messages are unique to the situation when the font size changes, in other words, when I receive the WM_SETTINGSCHANGE message I want to know what changed.

In theory when I define the OnSettingChange and Windows calls it, the lpszSection should tell me what the changing section is, and that works fine, but then I check the given section by calling SystemParametersInfo and I pass in the action SPI_GETNONCLIENTMETRICS, and I step through the debugger and I make sure that I watch the data in the returned NONCLIENTMETRICS for any font changes, but none occur.

Even if that didn’t work, I should still be able to check the DPI when the Settings change. I really wouldn’t care about the other details, every time I get the WM_SETTINGCHANGE message, I would just check the DPI and perform the actions I’m interested in performing, but I’m not able to get the system DPI either.

I have tried to get the DPI by invoking the method GetSystemMetrics, also for each DC:

Dekstop DC->GetDeviceCaps LOGPIXELSX/LOGPIXELSY Window DC->GetDeviceCaps LOGPIXELSX/LOGPIXELSY Current DC->GetDeviceCaps LOGPIXELSX/LOGPIXELSY

Even if I change the DPI in the Graphic Properties Window these values don’t return anything different, they always show 96.

Could anybody help me figure this out please? What should I be looking for? Where should I be looking at?

afx_msg void 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 with window DC     HDC desktop = ::GetDC(NULL); // try with desktop DC     CDC* device = CWnd::GetDC(); // try with current DC     HDC hDC = *device; // try with HDC     if( windowDC )     {         windowDPI = windowDC->GetDeviceCaps(LOGPIXELSY);          // always 96 regardless if I change the Font          // Size to Extra Large Fonts or keep it at 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 returns 96, but the settings changes DO take effect when I change the font size to Extra Large Fonts or if I change the DPI to 120 (from the graphics properties).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:48:43+00:00Added an answer on May 10, 2026 at 7:48 pm

    [EDIT after re-read] I’m almost positive that changing to ‘Large fonts’ does not cause a DPI change, rather it’s a theme setting. You should be able to verify by applying the ‘Large fonts’ change and then opening the advanced display properties where the DPI setting lives, it should have remained at 96dpi.


    DPI change is supposed to require a reboot. Maybe the setting hasn’t propagated to a place where GetDeviceCaps can retrieve it?

    Maybe try changing a non-reboot-requiring setting (resolution perhaps) and then see if you can detect the change. If you can, your answer is probably that you can’t detect DPI change until after reboot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 163k
  • Answers 163k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer According to your comment response on the question of having… May 12, 2026 at 12:06 pm
  • Editorial Team
    Editorial Team added an answer Subscribe to the onClose or the onSelect event: $("#someinput").datepicker( {… May 12, 2026 at 12:06 pm
  • Editorial Team
    Editorial Team added an answer Write a custom UITableViewCell. Google for "custom UITableViewCell" and choose… May 12, 2026 at 12:06 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.