Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect date/time format change in Windows

I have an application that's long running (and nearly always displayed) that shows the current time. Currently, if you change the timezone, time format, or language the format doesn't change unless I quit and restart the application. How can I detect when these change so that I can immediately refresh the formatting?

Note that this is native, not managed code (and I can't change that), so anything that's managed-only is right out.

like image 950
Donnie Avatar asked Jan 31 '26 23:01

Donnie


1 Answers

Changing the timezone sends a WM_TIMECHANGE message to all top-level windows, while changing the time format sends a WM_SETTINGCHANGE message. Changing the language (system locale) requires a reboot and so doesn't send a message.

like image 130
Ross Ridge Avatar answered Feb 04 '26 00:02

Ross Ridge