SetThreadExecutionState function (winbase.h) - Win32 apps

Enables an application to inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running.