kschang Posted April 20, 2010 Posted April 20, 2010 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. 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.
kschang Posted April 21, 2010 Author Posted April 21, 2010 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. 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.
AdmiralAlkex Posted April 21, 2010 Posted April 21, 2010 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 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
kschang Posted April 22, 2010 Author Posted April 22, 2010 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 That search box does NOT do partial words! I tried ScreenSave, Screensaver, and nothing relevant came up!
AdmiralAlkex Posted April 22, 2010 Posted April 22, 2010 (edited) You don't need partial words, you need SPI_GETSCREENSAVERRUNNING if you want examples for SPI_GETSCREENSAVERRUNNING. Edited April 22, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now