A program that runs only for limited hours
Many software, especially the ones that we download freely from the net have an expiry period. When we run these software a dialog is popped up which informs that we can use the software only for a specific number of days. And this count keeps reducing every day. Once the d-day passes we can no longer use the software. Writing such programs is easy, as the following program would demonstrate. Instead of deciding the expiry on number of days, I have taken the number of executions and number of minutes of usage as the basis for deciding expiry. Suppose the number of executions permissible are 100 and number of hours of usage permissible are 10. Every time the software is executed the user is prompted with a dialog shown in Figure 1. When the software is closed the remaining executions and remaining hours are reported. This is managed by updating the counts in registry every time the software is executed.
Labels: Visual C++