Warning, haven't tested this:
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
public static class Program
{
public static void Main()
{
while(true) {
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y + 1);
Thread.Sleep(60000);
}
}
}
This uses a managed method to move the mouse. We don't normally make direct Win32 API calls in .NET.
Should also be noted that moving the mouse is not really the right way to keep the screen on. Should instead call SetThreadExecutionState and set the ES_DISPLAY_REQUIRED flag.
Always interesting seeing what people come up with when they don't know a language. I had forgotten the "using static" construct existed. It's never used in practice because it's just syntactic sugar which obfuscates where you're getting the "Sleep" method from, making the code less readable.