I've looked at the tip listed here but it doesn't seem to work in XP, but that's ok because I can disable the screensaver with
RegWrite REG_SZ, HKEY_CURRENT_USER, Control Panel\Desktop, ScreenSaveActive, 0
But this doesn't disable the monitor power off. I'd like an easy way to do this, too. I'd prefer to not have a loop sending Shift key or mouse movements repeatedly because sometimes that pops up the video control overlay and disrupts the experience.
I came across the SetThreadExecutionState function from MSDN. This seems to be exactly the right thing, so I tried to call it with a dllcall:
Res := DllCall("SetThreadExecutionState", UInt, 0x80000000, UInt, 0x00000002) ; these parameters are for ES_CONTINUOUS and ES_DISPLAY_REQUIRED per MSDNThis doesn't prevent the monitor from turning off, and it returns (-2147483648), or 0xFFFFFFFF80000000. I'm not really sure what this means. Did the function execute correctly? MSDN says anything but a NULL return means ok execution, but the monitor still turns off!
I've tried every combination of Int, UInt, str, etc. to get it to work, no dice.
Sorry there's so much detail. All I really want is something simple, but I don't know enough of Windows API or ahk to get there.




