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

Miscellaneous

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

Problem with IntControl 57

Keywords:  Problem with IntControl 57 system keys

Question:

I am attempting to use Intcontrol 57 to disable the system keys, before I display an AskPassword dialog. The AskPassword dialog could be on the screen for a long amount of time (between user sessions), and if the screen saver comes on it will re-enable the system keys. Is there anything I can do?
Here is a snippet of code:
;Disable system keys
IntControl(57,1,0,0,0)
pw = AskPassword("Security check", "Please enter your password")

Answer:

You could disable the screen saver while the script is running....
; Disable the ScreenSaver if there is one
REGKEY=RegOpenKey(@REGCURRENT,"Control Panel\Desktop")
;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... 
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
;Disable system keys
IntControl(57,1,0,0,0)
pw = AskPassword("Security check", "Please enter your password")
OR

You could launch a second script the could check if a screen saver gets activated and if one does it can check when it is no loger running and re-attempt disabling the system keys.

;MAIN.WBT
;--------
IniWritePvt("Main","done","0","C:\Windows\desktop\screenchecker.ini")
;Disable system keys
IntControl(57,1,0,0,0)
;launch screen saver checker script
run("C:\program files\winbatch\system\winbatch.exe","C:\Windows\desktop\screenchecker.wbt")
pw = AskPassword("Security check", "Please enter your password")
;set flag
IniWritePvt("Main","done","1","C:\Windows\desktop\screenchecker.ini")


;SCREENCHECKER.WBT
;-----------------
;To test if it gets activated.... 
;To get the screen saver exe name (it will be a *.scr file, as in screensaver.scr) do... 
a=IniReadPvt("Boot","SCRNSAVE.EXE","NONE","SYSTEM.INI")

While @True
ret=IniReadPvt("Main","done","xxx","C:\Windows\desktop\screenchecker.ini")
if ret == 1 then break 
if !AppExist(a) then IntControl(57,1,0,0,0) 
EndWhile

;SCREENCHECKER.INI
;-----------------
[main]
done=0



Article ID:   W14254
Filename:   Problem with IntControl 57.txt
File Created: 1999:10:26:11:22:50
Last Updated: 1999:10:26:11:22:50