1. Create a global (module-level) variable called, say, datLastActivity. At key points in your application (enough so that any user activity will definitely send you through at least one of them), set the variable to Now().
Create a blank form and set its TimerInterval to, say, 60000=1 minute...