Starting and stopping the screensaver in C# can be done by calling the Windows API’s PostMessage function, which posts a message to the Windows Message Queue asynchronously. Starting it is straight forward. But stopping it is somewhat tricky. I accomplished this here by stopping the window on the foreground which will always be the screensaver [...]
A PInvoke Wiki for .NET Developers
PInvoke is short for Platform Invoke which is a service in the .NET Framework that enables managed code to call unmanaged functions in dynamic link libraries (DLLs). PInvoke.net is a wiki of Win32 and other unmanaged APIs for C# and VB.NET developers.

