Does anyone know of a Win API function that returns the length of time that a workstation has been idle (no keyboard or mouse activity). I need to be able to time-out an application after a specified interval. I'm sure Windows must provide this function because I imagine utilities like screensavers and Instant Messenger use it. But I don't seem to be able to find such a function in the Win API references I've used. I currently use VB5 on Windows NT. Thanks for your help.

Lew.