I have several applications that seem to turn off the screensaver and the powersave mode of the video card (eg Skype, VLC, mplayer, etc). Sometimes, these applications crash and the monitor is just on all the time until I reboot. I开发者_运维问答s there a simple API call to turn on the screensaver and powersave mode again?
These applications probably use SystemParametersInfo to turn off the screensaver, so you can use it yourself to change back. Here are the calls you may have to do:
SystemParametersInfo(SPI_SETLOWPOWERTIMEOUT,power timeout you want, NULL, 0);
SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, poweroff timeout you want, NULL, 0);
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,screensaver timeout you want, NULL, 0);
精彩评论