Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WMTimeChange

Status
Not open for further replies.

Gigatech

Programmer
Jul 12, 2000
80
CR
Hi, I use the following code to detect if the system date/time changes:

************************************************************
type
TForm1 = class(TForm)
private
procedure WMTimeChange(var Msg: TMessage) ; message WM_TIMECHANGE;
end;

var
Form1: TForm1;

implementation
{$R *.DFM}

procedure TForm1.WMTimeChange(var Msg: TMessage) ;
begin
inherited;
ShowMessage('Date/Time has changed!') ;
end;

**********************************************************

It works fine, but sometimes when the computer remains "on" during the night, in some moment, the event fires. What other reasons would fire this event beside the users change the system date/time?

thanks
 
Coul be Windows automatic time update (this is on by default in XP)
I dont know if this will trigger the event but you can look in the windows logs Admin tools/event viewer (XP/2000) to see if a time update has happend.


Steve [The sane]: Delphi a feersum engin indeed.
 
You may already be doing this but can you get it to log the events and the time it happend?

Steve [The sane]: Delphi a feersum engin indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top