apstanto 2 Posted September 8, 2010 (edited) I've based my script off of the code found here. The powersave/resume works except I'm having a little trouble with Windows XP (more info). But what I want to solve right now is how to turn on my screen when the computer resumes. I see this in Windows XP. I realize when you set an Automatic System-wakeup Event, it does not turn the display on. So I tried this Monitor On/Off help and it fairly well on it's own with the hot-keys. But the monitor on functionality doesn't seem to work after a standby or hibernate. Any ideas of how to get the monitor back on?Edit: Marked as [solved] Edited September 8, 2010 by apstanto Share this post Link to post Share on other sites
somdcomputerguy 103 Posted September 8, 2010 So I tried this Monitor On/Off help and it fairly well on it's own with the hot-keys. But the monitor on functionality doesn't seem to work after a standby or hibernate.Can't you just call the _Monitor_ON function in that script? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites
apstanto 2 Posted September 8, 2010 Can't you just call the _Monitor_ON function in that script?Yep, I did. It doesn't seem to have any effect after a resume. I think the System Wake-up Event does something different, not allowing the _Monitor_ON function to work. Share this post Link to post Share on other sites
apstanto 2 Posted September 8, 2010 After a resume, if I wiggle the mouse, the screen will come on. So I tried wiggling the mouse with the MouseMove function, but that didn't work either. Share this post Link to post Share on other sites
apstanto 2 Posted September 8, 2010 Finally I was able to solve this! I'm really excited! So here's what I found: according to Microsoft's System Wake-up Events, "When the system wakes automatically, the display is not automatically turned on." I was able to figure out how to get the screen on after a resume. The function below will do it. #cs ********************************************************************************************************* Function Name: _Monitor_ON Author: apstanto Description: Turns the monitor on after a System Wake-up Event and broadcast of PBT_APMRESUMEAUTOMATIC Input: None Return: Success: @error = 0. Failure: set @error @error: 1 unable to use the DLL file, 2 unknown "return type", 3 "function" not found in the DLL file, 4 bad number of parameters. #ce ********************************************************************************************************* Func _Monitor_ON() $ES_DISPLAY_REQUIRED = 2 DllCall("Kernel32.dll", "long", "SetThreadExecutionState", "long", $ES_DISPLAY_REQUIRED) EndFuncI hope this works for you too! 2 PHAK and Earthshine reacted to this Share this post Link to post Share on other sites
doorito 0 Posted June 17, 2011 Finally I was able to solve this! I'm really excited! So here's what I found: according to Microsoft's System Wake-up Events, "When the system wakes automatically, the display is not automatically turned on." I was able to figure out how to get the screen on after a resume. The function below will do it. #cs ********************************************************************************************************* Function Name: _Monitor_ON Author: apstanto Description: Turns the monitor on after a System Wake-up Event and broadcast of PBT_APMRESUMEAUTOMATIC Input: None Return: Success: @error = 0. Failure: set @error @error: 1 unable to use the DLL file, 2 unknown "return type", 3 "function" not found in the DLL file, 4 bad number of parameters. #ce ********************************************************************************************************* Func _Monitor_ON() $ES_DISPLAY_REQUIRED = 2 DllCall("Kernel32.dll", "long", "SetThreadExecutionState", "long", $ES_DISPLAY_REQUIRED) EndFunc I hope this works for you too! This works for me...Thank you... Now I can't figure out how to get the screensaver to go away, I have tried mousemove but it's probably moved in the background. Is there no way to simulate a hardware mouse or keyboard move? I have some unattended distribution at night, the problem is it requires a reboot after the distribution. If the Monitor is off and the screensaver is active(duh) the reboot will be stalled. When a user moves the mouse or press a key on the keyboard the shutdown is triggered. With your help, I'm so close... Share this post Link to post Share on other sites
gcue 10 Posted March 27, 2013 Finally I was able to solve this! I'm really excited! So here's what I found: according to Microsoft's System Wake-up Events, "When the system wakes automatically, the display is not automatically turned on." I was able to figure out how to get the screen on after a resume. The function below will do it. #cs ********************************************************************************************************* Function Name: _Monitor_ON Author: apstanto Description: Turns the monitor on after a System Wake-up Event and broadcast of PBT_APMRESUMEAUTOMATIC Input: None Return: Success: @error = 0. Failure: set @error @error: 1 unable to use the DLL file, 2 unknown "return type", 3 "function" not found in the DLL file, 4 bad number of parameters. #ce ********************************************************************************************************* Func _Monitor_ON() $ES_DISPLAY_REQUIRED = 2 DllCall("Kernel32.dll", "long", "SetThreadExecutionState", "long", $ES_DISPLAY_REQUIRED) EndFunc I hope this works for you too! it worked for me too! laptop, desktop (xp and win 7) great job! thanks Share this post Link to post Share on other sites
jctenne 0 Posted March 4, 2014 This worked for me too on Windows 7! Thanks. Share this post Link to post Share on other sites
adcrazynoga 0 Posted February 1, 2018 It work fine, but just for AC mode. I dont know why when i plug out. It doesn't work for battery mode. Anyone can help me ? Share this post Link to post Share on other sites