Search code examples
winapilocaleregional-settingscontrol-panel

Detect changes in user locale setting (Control Panel -> Clock,Language and Region) in child dialog box


I have dialog box made in resource editor that behaves as a child control of the main window.

In normal mode, when behaving as a popup, dialog can receive WM_SETTINGCHANGE message that notifies dialog box about user changing locale settings, but as a child it does not seem to receive this message -> after setting up a breakpoint at relevant code, the debugger never reaches those lines.

Is there a way to detect in child dialog box when user changes locale in Control Panel?


Solution

  • WM_SETTINGCHANGE is sent to top-level windows only. So if your child window needs to know about it, have your top-level window forward it on (i.e. with SendMessage(hwndChild, uMsg, wParam, lParam); or similar).