Jump to content

Run AutoIt Script AFTER exit from ScreenSaver?


Recommended Posts

There is a bug in WinVista that when you come out of hibernation or sleep, occasionally you lose your entire taskbar. The start button is still there, but the taskbar disappeared. The simplest way is to toggle the "auto-hide" property of the taskbar in "properties".

With launch of Win7, there apparently is no plan for MS to fix this bug. (And yes, I have SP2, it's still there)

I got an AutoIt script to flip the hide/show, no problem. However, I'd like to automate the process, by making it run just as the system came out of screensaver.

I was not a Windows developer, but I can hum the tune. :idea: I presume this will probably involve listening to some sort of a Window Message?

I can think of an alternative approach: create a wrapper around the screensaver (run the screensaver with a invisible "wait", THEN run the script, but I am looking for a more elegant approach.

Link to comment
Share on other sites

There is a bug in WinVista that when you come out of hibernation or sleep, occasionally you lose your entire taskbar. The start button is still there, but the taskbar disappeared. The simplest way is to toggle the "auto-hide" property of the taskbar in "properties".

With launch of Win7, there apparently is no plan for MS to fix this bug. (And yes, I have SP2, it's still there)

I got an AutoIt script to flip the hide/show, no problem. However, I'd like to automate the process, by making it run just as the system came out of screensaver.

I was not a Windows developer, but I can hum the tune. :idea: I presume this will probably involve listening to some sort of a Window Message?

I can think of an alternative approach: create a wrapper around the screensaver (run the screensaver with a invisible "wait", THEN run the script, but I am looking for a more elegant approach.

Found part of the answer... Apparently, there is no windows message. There is a message to TRIGGER the screensaver (actually, it's a message to minimize all the windows, called SC_SCREENSAVER). However, there is no message when the screensaver ends.

However, there is a system parameter that tells you if the screensaver is running: http://support.microsoft.com/kb/315725

So apparently, you have to keep polling the parameter, to create a "state machine", sort of, and trigger the code when it flips from on to off.

I haven't quite worked out the loop yet (it's midnight) as I haven't had a chance to try the user32.dll call. Can someone look over this?

$result = DllCall("user32.dll", "BOOLEAN", _   ;dll, and return type
"SystemParametersInfoA", _  ;the function we're calling
"long", &H72 , _  ; type 1 and param 1
"long", 0, _
"boolean", bActive, _
"boolean", false )

This is my first script, and I think I'm a bit over my head. :)

Link to comment
Share on other sites

Hi and Welcome to the forum!

Do you see the search box in the upper-right? Search for SPI_GETSCREENSAVERRUNNING and you'll get some examples :idea:

That search box does NOT do partial words! I tried ScreenSave, Screensaver, and nothing relevant came up!

Link to comment
Share on other sites

You don't need partial words, you need SPI_GETSCREENSAVERRUNNING if you want examples for SPI_GETSCREENSAVERRUNNING.

Edited by AdmiralAlkex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...