2012-04-13 17 views
2

SetTimeZoneInformationを使用してWindowsでTimeZoneと夏時間を変更することはできますが、wMonthを0に設定しても、datetime.cplのチェックボックスがオンになっています。SetTimeZoneInformationで「日光を調整する」のチェックを外すにはどうすればいいですか?

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レジストリキーも手動で作成/削除する必要がありますか?

おかげ

答えて

0

手動でレジストリキーを作成/削除を行うための方法です...

関連する問題