1

I am currently using LicenseFile=

Is there a way to add a timer to the next button? That way if a certain time period hasn't elapsed it will ask the user if they have actually read the agreement?

Thanks

Tsukasa
  • 6,342
  • 16
  • 64
  • 96

1 Answers1

1

There isn't anything built-in, but you can call the standard WinAPI GetTickCount function:

function GetTickCount(): Cardinal;
external 'GetTickCount@kernel32.dll';

Call it once from CurPageChanged(wpLicense) to save the current tick value in a global variable, and then again from NextButtonClicked(wpLicense) and subtract the new tick from the old tick to get the elapsed time.

Two points to note, however:

  1. Just because the page has been open for a while doesn't mean that they've actually read it.

  2. I haven't tested but I'm pretty sure NextButtonClick will be called even if they haven't selected "yes" (ie. the code handler is called before the internal validation). So you may want to check for this too, to avoid displaying the "have you read it?" message when they haven't even ticked Yes yet.

Miral
  • 12,637
  • 4
  • 53
  • 93
  • +1 for the first point. I would probably prefer to combine check of the time elapsed since the page was displayed with the information if user moved the scrollbar to the bottom of the license memo (like [`this way`](http://stackoverflow.com/q/10584610/960757)). – TLama Jan 17 '13 at 16:55