Preventing screensaver in glut app

How can I prevent the [Windows] screensaver from starting when running a glut-based application? I think I’ve read somewhere how to do it by taking care of specific windows messages in non-glut applications. Is there a similar (or different) method for glut-based applications?

Not tried this yet, but according to the MSDN (Technical documentation | Microsoft Learn), you should be able to use
SetThreadExecutionState( ES_DISPLAY_REQUIRED );