Quote:
Teamviewer has a feature that can turn off monitor permanently. So I believe that it is possible to write a code like that.
No they do not turn off the monitor, they hide the display and hijack the hooks related to display. Not the same thing.
They have their own screen saver which eat the monitor wakeup events contrary to usual screen savers. Reason old monitors can not be turned off.
Be sure they hijack all necessary system hooks.
This kind of stuff is far beyond normal programmer knowledge, it is a specialist job which means deep knowledge about Windows internals.
your first step would be to write your own screen saver from scratch (without library that hide all difficulties).