Page 1 of 1

Using Winbase.h to Disable Screensaver

Posted: Tue Sep 21, 2021 1:44 pm
by studawg66
I have used "ctypes" in Python to implement a screensaver disable in my Python programs, based on the SetThreadExecutionState as described here:
https://docs.microsoft.com/en-us/window ... utionstate
https://eddiejackson.net/wp/?p=23435

But now I need to implement the same thing in a Livecode app and I'm struggling to understand how to call this function. Seems like it would be a simple thing, but most of the information I have found is how to make your own externals and use them in Livecode. But I just need to call this existing Windows function with arguments. Any help is greatly appreciated.

Re: Using Winbase.h to Disable Screensaver

Posted: Fri Oct 22, 2021 12:52 pm
by Klaus
Looks like we can do this with a SHELL call:
https://answers.microsoft.com/en-us/win ... aeb8a5cf09

Save these two commands in a custom property or field and call it whenever needed.
I am a Mac guy, so I cannot test it here, but should work (famous last words ;-))