Purpose: The date / time settings can change a lot the functionality of your application. But how to detect, if the user changes these settings while the application is running?

Description: Whenever the date / time settings are changed, Windows is sending a message: WM_ TIMECHANGE. All we have to do, is to intercept this message:

procedure WMTimeChange(var Message: TMessage); message WM_ TIMECHANGE;
...
procedure TfMain.WMTimeChange(var Message: TMessage);
begin
ShowMessage('Date / time settings changed!');
inherited;
end;

Don't forget to place the inherited keyword at the end of the WMTimeChange procedure, otherwise Windows will not process this message correctly.