PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Win2k doesn't send WM_TIMECHANGE on daylight savings event

 
 
Daniel Anderson
Guest
Posts: n/a
 
      15th Jan 2004
I seem to have a problem under win2k. Applications relying
on the WM_TIMECHANGE message to do recalculations when the
local time changes will fail. If the clock is changed
either manually or through synchronization via our LAN, the
message is received loud and clear. But at 2AM on a day
going into or out of daylight savings time, there is no
message sent by the os. My bios does not have the ability
to adjust for daylight savings time, so there is no
interference there. Under XP, applications receive this
message as expected. Anyone else find this? My
understanding is that Pre-NT5 os requires all apps to send
this message to all top level windows when they changed the
system time, and NT5+ handles WM_TIMECHANGE on its own with
no application to send. It seems as though the W2K codeset
responsible for the DST changeover does not comply with the
design.

Platform: Windows 2000 SP3, SP4
Timezone: GMT -3:00 Greenland
Times: (Scenario 1) April 4, 2004, 1:59 AM
(Scenario 2) October 31, 2004, 1:59 AM
Application: A simple C++ MFC SDI application, handling
WM_TIMECHANGE. Also tested with C application running as a
service but registered as a windows class, handling
WM_TIMECHANGE.

In Scenario 1, the time and date is set to the specified.
At 2:00AM, the clock display jumps to 3:00AM, as expected.
No WM_TIMECHANGE message is recieved by the application
under W2K, however it does with XP.

In Scenario 2, the time and date is set to the specified.
At 2:00AM the clock display jumps back to 1:00AM, as
expected. No WM_TIMECHANGE message is recieved by the
application under W2K, however it does with XP.


Cheers,
Dan
 
Reply With Quote
 
 
 
 
Daniel Anderson
Guest
Posts: n/a
 
      29th Jan 2004
According to the following MSDN article, Windows 2000 and
XP should behave the same way. But during a daylight
savings change, XP sends WM_TIMECHANGE to applications, but
2000 does not. Why? Where is this documented?

----------------------
WM_TIMECHANGE
An application sends the WM_TIMECHANGE message whenever it
updates the system time.

To send this message to all top-level windows, an
application can use the SendMessage function with the hWnd
parameter set to HWND_TOPMOST.

Windows 2000/XP: An application should not broadcast this
message, because the system will broadcast this message
when the application changes the system time.

Windows NT 4.0 and earlier: An application should send this
message to all top-level windows after changing the system
time.

Windows 95/98/Me: An application should send this message
to all top-level windows after changing the system time.

----------------------


 
Reply With Quote
 
 
 
 
John Phillips
Guest
Posts: n/a
 
      29th Jan 2004
I've seen the same behaviour Daniel, at least on the Win2k side. I'll try
with my WinXP machine when I get home tonight.

My first thought was that because the documentation for WM_TIMECHANGE says
that it is broadcast when the -=system time=- changes (which is always in
GMT), that it would make sense that it would -=not=- be broadcast when
entering or leaving DST (wouldn't explain the XP issue, but still...). But
when I change the time zone on my Win2k system, a WM_TIMECHANGE message is
fired.

As a workaround, you could:
- check the local time every few seconds or so (yuck)
- change your calculations to be based on GMT
- watch the
HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias
value by using RegNotifyChangeKeyValue() (this value changes when there is a
DST transition as well as when the time zone changes).



--
John Phillips
MVP - Windows SDK



"Daniel Anderson" <(E-Mail Removed)> wrote in message
news:65fb01c3e632$12b08f20$(E-Mail Removed)...
> According to the following MSDN article, Windows 2000 and
> XP should behave the same way. But during a daylight
> savings change, XP sends WM_TIMECHANGE to applications, but
> 2000 does not. Why? Where is this documented?
>
> ----------------------
> WM_TIMECHANGE
> An application sends the WM_TIMECHANGE message whenever it
> updates the system time.
>
> To send this message to all top-level windows, an
> application can use the SendMessage function with the hWnd
> parameter set to HWND_TOPMOST.
>
> Windows 2000/XP: An application should not broadcast this
> message, because the system will broadcast this message
> when the application changes the system time.
>
> Windows NT 4.0 and earlier: An application should send this
> message to all top-level windows after changing the system
> time.
>
> Windows 95/98/Me: An application should send this message
> to all top-level windows after changing the system time.
>
> ----------------------
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want WinXP not change Daylight Savings in domain =?Utf-8?B?S2VpdGhELg==?= Windows XP Help 2 29th Mar 2005 04:50 PM
daylight savings and outlook calendar =?Utf-8?B?UmljaA==?= Windows XP Help 1 17th Apr 2004 01:07 AM
event viewer log time changes after daylight savings Rextraylor Windows XP Security 0 5th Apr 2004 05:22 PM
event viewer log times change w/daylight savings Rextraylor Windows XP Basics 0 5th Apr 2004 04:48 PM
Estimating Savings When The Interest Rate Changes Based Upon Savings Amount GEORGE Microsoft Excel Misc 1 28th Aug 2003 09:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:35 PM.