Hrv*_*eša 10 windows time synchronization ntp
是否有一个Windows API可以实现相当于单击"日期和时间属性"/"Internet时间"选项卡中的"立即更新"按钮(通过双击任务栏中的时钟打开)?
有没有办法监视窗口何时触发时间同步以及何时成功或失败?
时间服务没有公开API,但是为了触发时间同步,您可以使用w32tm命令行工具.
在C/C++中,你可以这样做:
include <process.h>
...
system("w32tm /resync /nowait");
Run Code Online (Sandbox Code Playgroud)
查看w32tm文档以获取更多选项.