Anti Reserse Clock

Posted on 2001-08-04
Last Modified: 2008-02-01
I wanna ask how can I make anti reverse clock .
I have written a demo application expire in specific date,
and I want to prevent program run again, if its expire and the user try to change back the date.

Do any one have good techniques, and what's the method to do that.
I know that any application change the system time send WM_TIMECHANGE to all top windows .
we can capure this message and detect if the system time has been changed.

first, how can I capture this meesage. if I use a background services capture this message. and is this technique usefull.
is there another techniques can I use ..?

Question by:AAB
LVL 32

Accepted Solution

jhance earned 207 total points
ID: 6351545
The most common technique is to keep a log of the run times of the application and see if you get a new run that is "older" than some prior run.  That way, you know that the clock has been messed with and you can refuse to run or do whatever you want.

I think that your WM_TIMECHANGE method is unreliable since:

1) Your app must be running all the time to catch this.
2) If the system clock is changed via the BIOS setup, you'll never see this change.

Expert Comment

ID: 6354079
I think the best thing to do will be to simply use the windows registry for this.
Make two entries as
First Access
Last access

Based on these two entries you can always check the no of days since last access and also no of days since the installation of your application.
LVL 11

Expert Comment

ID: 6845275
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "jhance" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is:


Expert Comment

ID: 6871251
Per recommendation comment force/accepted by

Community Support Moderator
Experts Exchange

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now