1. Mikhael Botvinik
  2. PowerBuilder
  3. Sunday, 16 August 2020 06:57 AM UTC

Is it possible to close an application that has not been used during the week using the function Idle(604800), or is 604800 too high value for the Idle function?
Does the Idle function take away large Windows resources?
After adding Idle(604800), we started receiving complaints that the app was closing after a few hours or days.

Thanks.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 16 August 2020 12:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi Mikhael;

   The Idle() command only starts a timer for the application to monitor non-use. For a super long period because the idle timer is in seconds, I would use a value for one day. Then in the Idle Event, use a counter to track the number of days. Once the day counter hits the maximum, close the app.

HTH

Regards... Chris

Comment
  1. John Fauss
  2. Sunday, 16 August 2020 17:22 PM UTC
Or you could utilize the technique you describe above, Chris, with a "shorter" one-hour idle time interval and a counter of accumulated idle intervals. 168 idle intervals would give you one "idle week".
  1. Helpful
  1. Mikhael Botvinik
  2. Monday, 17 August 2020 08:27 AM UTC
Thanks.

And how( in which event) do I reset the counter to start counting again if the user did something in the app?

I want to catch a continuous week of inactivity.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 17 August 2020 18:27 PM UTC
Hi Mikhael;

Great question!

You would need to add a "MouseMove" and a "Key" event to your Ancestor Window class. In there, reset your day counter to Zero. The same for the DW Control. That should then perform this action on any user interaction with the PB Application. HTH

Regards ... Chris

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.