Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to detect the change of the Date or time of you PC. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Detect the change of the Date or time of you PC. 18-Oct-04
Category
Win API
Language
CBuilder All Versions
Views
653
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   //this code is helpful if you want to write an app to detect whenever
2   //the system time of you PC has changed.
3   //-----------------------------UNIT1.H-------------------------------------
4   
5   #ifndef Unit1H
6   #define Unit1H
7   //---------------------------------------------------------------------------
8   #include <Classes.hpp>
9   #include <Controls.hpp>
10  #include <StdCtrls.hpp>
11  #include <Forms.hpp>
12  //---------------------------------------------------------------------------
13  class TForm1 : public TForm
14  {
15  __published:	// IDE-managed Components
16          TButton *Button1;
17          void __fastcall Button1Click(TObject *Sender);
18  private:	// User declarations
19  void __fastcall WMTIMECHANGE(TMessage &Message);
20  public:		// User declarations
21          __fastcall TForm1(TComponent* Owner);
22        BEGIN_MESSAGE_MAP
23              VCL_MESSAGE_HANDLER(WM_TIMECHANGE, TMessage,WMTIMECHANGE)
24              END_MESSAGE_MAP(TForm)
25  
26  
27  };
28  //---------------------------------------------------------------------------
29  extern PACKAGE TForm1 *Form1;
30  //---------------------------------------------------------------------------
31  #endif
32  
33  //-----------------------------UNIT1.CPP----------------------------------
34  #include <vcl.h>
35  #pragma hdrstop
36  
37  #include "Unit1.h"
38  //---------------------------------------------------------------------------
39  #pragma package(smart_init)
40  #pragma resource "*.dfm"
41  TForm1 *Form1;
42  //---------------------------------------------------------------------------
43  __fastcall TForm1::TForm1(TComponent* Owner)
44          : TForm(Owner)
45  {
46  }
47  //---------------------------------------------------------------------------
48  
49   void __fastcall TForm1::WMTIMECHANGE(TMessage &Message)
50      {
51    ShowMessage("Time changed");
52  
53      }
54  void __fastcall TForm1::Button1Click(TObject *Sender)
55  {
56  Form1->Close();
57  }


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC