I'm just starting to develop an app which requires some security features due to the nature of the data. One of the items in the spec is that after say 30 mins of inactivity, the application locks out the user and they to re-input their password to continue. I'm trying to figure out the best way to do this.
I thought of having a timer class ticking away in the background, incrementing a counter. When the counter reaches a certain value, it calls the lockout routine. I would then need to intercept keystrokes and reset the counter each time a key is pressed or mouse clicked. I'd use the keypreview property to get the keystroke before the control with focus and the keypress event of the form would do the reseting of the counter. Trouble is there's LOTS of forms in the app, so this would have to be set on every form (I suppose I can make a new form class...).
I did spot you can set the _SCREEN to have keypreview, BUT it has no keypress event for you to then process any keystrokes! That would seem the tidiest place to control the counter from, but I can't see a way of doing it.
Anyone every done this before or have any better ideas?
TIA
Ric
I thought of having a timer class ticking away in the background, incrementing a counter. When the counter reaches a certain value, it calls the lockout routine. I would then need to intercept keystrokes and reset the counter each time a key is pressed or mouse clicked. I'd use the keypreview property to get the keystroke before the control with focus and the keypress event of the form would do the reseting of the counter. Trouble is there's LOTS of forms in the app, so this would have to be set on every form (I suppose I can make a new form class...).
I did spot you can set the _SCREEN to have keypreview, BUT it has no keypress event for you to then process any keystrokes! That would seem the tidiest place to control the counter from, but I can't see a way of doing it.
Anyone every done this before or have any better ideas?
TIA
Ric