Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt


Expert Comment

ID: 6871251
Per recommendation comment force/accepted by

Community Support Moderator
Experts Exchange

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SetCurrentDirectory path limit 7 131
Cross compile release version of c++ program for linux 2 136
FMX enumerated colours 2 115
How to split this in C++ 4 106
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

856 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