For Windows XP, like I said, the interval of this timer is unconfigurable. I read, it's about 120 seconds. In my case it was some 9 minutes (maybe 512 seconds?)
The simple option, a flag for SetThreadExecutionState() that theoretically should work, didn't, so I built in a 60-seconds-timer, that resets the idle timer explicitly until the user interacts. On interaction, this timer is stopped and everything is back to normal.
Version 1.0.3: A new feature is the ability to execute a user-defined command after wake-up. This command must be stored in the first line of a file named "StayAwakeExec.txt" in the same directory as StayAwake.exe.
Examples of "StayAwakeExec.txt":
C:\WINDOWS\notepad.exe /wakeup (Parameters are supported)
"C:\Program files\tools.cmd" (paths containing spaces must be in quotes)
10?"C:\Programme\Mein Skript.vbs" (this would cause a delay of 10 seconds before the execution of the command)
This TXT file is read on every automatic wake-up of the system, when StayAwake is running.
Version 1.0.4: The "SetThreadExecutionState()" is deactivated in the event method (on wakeup and user interaction), because it caused my display to flicker shortly on first user interaction and thus causing my TV app to hang. The SetThreadExecutionState() is only called in the KeepAliveTimer method now.
Version 1.0.5: Minor enhancements regarding messages in the event log and the debug mode.
Version 1.0.6: Important bug fixes / enhancements in the StayAwakeExec.txt - functionality.
Download binary StayAwake.exe (Current Version: 1.0.6)
Download source StayAwake.cs
Build / install: