Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I want to block my running application if not used for specific period. For this I want to set particular value after which my application will show login screen and user will re-login in the application.

I come to know that IMessagefilter can be use for the same but totally unware how to put this into the code.

If anybody done this kind of functionality please guide me for the same.

Vinay Sarmalkar
Posted

Maybe this Codeproject-article[^] on IMessagefilter is of help.
 
Share this answer
 
You can use a Timer[^] to fire an event after inactivity (set with the Interval property). From your IMessageFilter.PreFilterMessage method, you can call Timer.Stop() then Timer.Start(), which will effectively reset the timer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900