For example, how does the program detect when the user hasn\'t used it for 5 minutes?
In WinForms there is an Application.Idle event:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.idle.aspx