Would it be possible to write a program that monotors the monitor power state? (on or off) And if possible, if the screen is turned off at the power button and the power is turend back again that the pc will shut itself down unless you turned on the power twice in a row within 5 seconds?

I know this sounds a bir weird, but I want to know