Using Winbase.h to Disable Screensaver

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
studawg66
Posts: 25
Joined: Wed Jun 17, 2015 9:40 pm

Using Winbase.h to Disable Screensaver

Post by studawg66 » Tue Sep 21, 2021 1:44 pm

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.

Klaus
Posts: 12499
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Using Winbase.h to Disable Screensaver

Post by Klaus » Fri Oct 22, 2021 12:52 pm

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 wrods ;-))

Post Reply

Return to “Windows”