Мне нужно остановить окна от сна, когда моя программа запущена.
И я не только хочу предотвратить таймер сна, но также хочу отменить событие сна, если я нажму кнопку спящего режима или каким-либо другим способом активно скажу компьютеру спать. Поэтому SetThreadExecutionState недостаточно.
Или... На самом деле мне не нужно полностью предотвращать сон, задерживайте его 5-10 секунд, чтобы моя программа завершила задачу.
(Я знаю, что это плохое поведение программы, но это только для личного использования.)