In the previous version of my Application to enable capture that the time had been changed in Windows I implemented an IMessageFilter to capture WM_ that is sent by windows when the time has changed.
I know that now with .NET 4 (previously I was using .NET 2 (with reflection) to “ResetTimeZone” I can just call ClearCachedData.
What I’m hoping is that there is some Event that I can attach to in the BCL which I may not have seen that can report the Time has been changed.
If not, I’ll just stick with my existing Filter. Does such an event exist? Similar to the System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements
System.Windows.Forms.IMessageFilter.PreFilterMessage
Select Case m.Msg
Case 30
System.Globalization.CultureInfo.CurrentCulture.ClearCachedData()
'ResetTimeZone()
RaiseEvent TimeChanged(Me, EventArgs.Empty)
Case Else
End Select
End Function
I think this is what you’re looking for:
SystemEvents.TimeChanged