tags:

views:

121

answers:

3

I was wondering if there's some sort of system event that gets fired every time a user changes the time in Windows. I know there's a way to enable this in Windows' EventLog, but I was looking for a way to respond to this event programatically (like using the Windows API).

+9  A: 

A WM_TIMECHANGE message is sent whenever there is a change in the system time

Stuart Dunkeld
+1, correct answer to one of the possible intents of an ambiguous question
JaredPar
Agreed, I'm sorry for the ambiguity.
enriquein
+3  A: 

I'm not sure from your question if you're working in managed or native code. But if you're working in managed code you can use the TimeChanged event on the SystemEvents class.

Microsoft.Win32.SystemEvents.TimeChanged

JaredPar
My apologies for not being completely clear. But yes, I will be running this on a managed environment so your answer is what I was looking for.
enriquein
+1 back, it's only fair!
Stuart Dunkeld
A: 

WM_TIMECHANGE exists since windows 3.0, for 19 years !
Incredible to ask a such thing nowadays ...