当人在 Windows 上更改时钟时是否有 API 事件? [英] Is there an API event for when person changes clock on Windows?
问题描述
我想知道每次用户在 Windows 中更改时间时是否会触发某种系统事件.我知道有一种方法可以在 Windows 的 EventLog 中启用它,但我一直在寻找一种以编程方式响应此事件的方法(例如使用 Windows API).
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).
推荐答案
根据您的问题,我不确定您是使用托管代码还是本机代码.但是,如果您在托管代码中工作,则可以在 SystemEvents 类上使用 TimeChanged 事件.
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
这篇关于当人在 Windows 上更改时钟时是否有 API 事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!