I see two questions here:
- Calculate active time
- Logout user after inactivity
The first can be calculating by using some of the event handlers in MapBasic to keep track of the time where MapInfo Pro seems to be used.
The event handler is called for example when the map is updated, when another window gets activated etc. Whenever this happend, record the time it happened. Compare the current time with the previous one. If they are close, the user is continuingly being active.
If the time before two events gets too big, it could seem that the user has been on a break or at least hasn't used MapInfo Pro some time. Now you can record this a inactive time, record the previous active time period and start a new active time period.
The second is a bit more tricky as MapInfo Pro needs to respond to inactivity. To me this can only be achieved with a timer, for instance build in .NET and made available to MapBasic via an assembly.
Everytime the user uses MapInfo Pro, that is an event handler is activated, the timer gets reset, for instance to 5 minutes or 10 minutes.
If the user get inactive, the timer will call a specific predefined procedure in your application after the set amount of time. This will raise awareness of inactivity and show the "login" screen. At the same time it can close the current active period.
I hope this makes sense to you