Solved

Anti Reserse Clock

Posted on 2001-08-04
4
253 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

763 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

8 Experts available now in Live!

Get 1:1 Help Now