That code will not work properly as-is.
By setting SETSCREENSAVEACTIVE to false you effectivly turn off the screensaver. It will not turn back on unless you actually moved your mouse or pressed a key. So, if no more messages are recieved your screensaver will not kick in anymore either.
Also, you would be interfearing with the Windows settings of the user, which you do not want to do; you don't need to write the settings to the current user profile to make the new (temporary settings) active.
And you assume that the screensaver is enabled in that code, which will not always be the case either.
So instead, you need to read in the current setting first, then deactivate, then set it back to what it was (so you do not need the (un)initialize functions).
For more information see
KB140723 and MSDN library.
------------------------------------
quote:
Originally posted by felipEx
I dont know if there is such script [...]
Not a script, but already requested and answered some time ago:
Help disabling Windows Screensaver