Solved

Anti Reserse Clock

Posted on 2001-08-04
4
284 Views
Last Modified: 2008-02-01
I wanna ask how can I make anti reverse clock .
explaining.
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 ..?

Thanx.
0
Comment
Question by:AAB
4 Comments
 
LVL 32

Accepted Solution

by:
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.
0
 
LVL 3

Expert Comment

by:null_pointer
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.
0
 
LVL 11

Expert Comment

by:griessh
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

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6871251
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

685 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