?
Solved

Anti Reserse Clock

Posted on 2001-08-04
4
Medium Priority
?
294 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
[X]
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
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 828 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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.
Suggested Courses

762 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