2

我成功地更改了 Windows 中的 TimeZone 和日光时间,SetTimeZoneInformation但即使将 wMonth 设置为 0,datetime.cpl也会选中复选框。

TIME_ZONE_INFORMATION actual = new TIME_ZONE_INFORMATION();
NativeMethods.GetTimeZoneInformation(out actual);
// Datetime.cpl put the standard time in daylight time and add the regkey
// When executing this -> Regkey is not set automatically
actual.DaylightBias = actual.StandardBias;
actual.DaylightDate = actual.StandardDate;
actual.DaylightName = actual.StandardName;
RunWin32Method(() => NativeMethods.SetTimeZoneInformation(ref newZone));
NativeMethods.SendMessageTimeout(NativeMethods.HWND_BROADCAST, NativeMethods.WM_SETTING_CHANGE, IntPtr.Zero, IntPtr.Zero, 0x00, 1000, out ptr)

// MSDN said
// When executing this -> Regkey is not set automatically
actual.StandardDate.Month = 0;
RunWin32Method(() => NativeMethods.SetTimeZoneInformation(ref newZone));
NativeMethods.SendMessageTimeout(NativeMethods.HWND_BROADCAST, NativeMethods.WM_SETTING_CHANGE, IntPtr.Zero, IntPtr.Zero, 0x00, 1000, out ptr)

我怎样才能改变这个?我也需要手动创建/删除DisableAutoDaylightTimeSet注册表项吗?

谢谢

4

1 回答 1

0

手动创建/删除注册表项是...

于 2012-04-27T09:57:06.783 回答