How can I detect (e.g. from a batch script or a utility) the time beeing elapsed since
the last movement with the mouse? Is this a registry entry ?

The value must be stored somewhere since screensavers use this value to activate themselves.

Tim