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
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: ... utionstate

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.

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

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: ... 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”