WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Screensaver

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Screensaver Info

Keywords:  Screensaver info off on screensave saver disable screensaver

How do I determine if the Screensaver is on?

To check if Screensaver is on, find the name of the .scr file in the System.ini. then:

Example:

	If AppExist("screensaver.scr") then a=1
	else a=0
	message("It is", a)

Question:

My unattended WinBatch application runs fine AS LONG AS I DON'T HAVE MY SCREEN SAVER ENABLED. What happens is if the screen saver kicks in (which it always does, due to the fact that the computer sits idle for 4 1/2 hours before the report kicks off) Winbatch will start MS Word and just sit there waiting for keystrokes that never come. What's the solution?

Answer:

Winbatch basically cannot send keystrokes while the screen saver is active. The problem is that the SendKey function emulates the user typing on the keyboard fairly well. It cannot get thru the screen saver.

You can probably talk with Word via DDE to make it do what you need so that you can run both the screen saver and Word and have it all work.

Q: Can MouseMove or SendKey(" ") wake up the screen saver?

A: There seems to be mixed information on this. I think it might depend on exactly what screensaver is loaded. Then some times the password box pops up. It also depends on the screensaver as to whether or not WinBatch can fill in the password.

This works when you can't have the screensaver on. A mouse move works for when the screensaver is on when the batch kicks in:

	MouseMove(335, 110, "", "") ;moves mouse in case screensaver is on
	WinParmSet(7, "0", 3) ; sets time for screensaver to zero

Disabling Screensaver Code:

This is code I wrote to disable the screensaver if active:
; Disable the ScreenSaver if there is one
REGKEY=RegOpenKey(@REGCURRENT,"Control Panel\Desktop")
SAVER = "NONE"
If RegExistValue(REGKEY,"[SCRNSAVE.EXE]") Then
SAVER = RegQueryValue(REGKEY,"[SCRNSAVE.EXE]")
RegDelValue(REGKEY,"[SCRNSAVE.EXE]")
RegSetValue(REGKEY,"[ScreenSaveActive]","0")
IntControl(59, -1, "", 0, 0)
End If
SAVER = The name of the screensaver they were using in case you want to store it in an INI file to set back again after you're all done...
Article ID:   W13816
Filename:   Disable Screensaver.txt
File Created: 2003:05:28:07:50:46
Last Updated: 2003:05:28:07:50:46