El 10/08/17 a las 13:11, James Richters escribió:
You need to use PostMessage if you want to your program to work correctly. 
SendMessage waits reply and you don't have a message pump in your console 
application, thus a hang happens.
Thank you... PostMessage() works to turn off the display, but for some strange 
reason it can't turn it back on.   I set a 20 second delay, and precisely at 20 
seconds my  monitor light turns green, but then the monitor goes back to sleep 
before the screen can be displayed.  I'm guessing the signal is being sent to 
turn on the monitor, but not to get windows out of power save mode...  I also  
see using -1 to turn the display back on is an un-documented feature.    I can 
get the display back on with a keystroke or moving the mouse, but I'm wanting 
the program to turn the display back on without user input.  Can anyone think 
of any other way I could make my console

I have found this:

https://stackoverflow.com/questions/25011141/turn-off-on-monitor-cant-turn-on

It's in c++, but it looks that since w.8, you must simulate a mouse move.

--
--------
Saludos
Santiago A.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to