Re: disable keyboard and mouse while running script
- From: jgarringer@xxxxxxxxx
- Date: 1 Sep 2006 19:58:30 -0700
Hi justlearnin,
You can do this with the AutoItX3 control available for free from
http://www.autoitscript.com. The only drawback to this solution is
that it can't be done by wsh natively. Once you install the AutoItX3
software you will need to register the autoitx3.dll file by opening a
command prompt and then changing directories to the location where you
installed AutoItX3. The .dll file you are looking for is installed in
the C:\Program Files\AutoIt3\AutoItX folder by default. (You will also
notice a handy help file in the same folder documenting the various
features of this add-on.)
After you have changed directories to the AutoItX folder type the
following command to
register the .dll file:
regsvr32.exe autoitx3.dll
You will get a message that the registration has succeeded. You don't
need to reboot.
Once this is done you can script this object.. here's an example that
might help.
The InputOff sub turns off keyboard and mouse input...the InputOn sub
turns them both back on again. The sleep statement between calling the
subs is simply to demonstate that you could put your own script code in
between the other two lines to get the same effect.
-------------
InputOff
WScript.Sleep 10000 'replace this line with your own code
InputOn
Sub InputOff
On Error Resume Next
Set objAutoIt = CreateObject("AutoItX3.Control")
If Err.Number = 0 Then
objAutoIt.BlockInput 1
End If
End Sub
Sub InputOn
On Error Resume Next
Set objAutoIt = CreateObject("AutoItX3.Control")
If Err.Number = 0 Then
objAutoIt.BlockInput 0
End If
End Sub
---------------
Hope this helps.
James Garringer
justlearnin wrote:
I know this is possible, but not sure how. I saw something on an exicutible
called doblock.exe, not sure where to find it. Any other ideas?
.
- Prev by Date: Re: HOWTO: Re-raise an error?
- Next by Date: Re: Parameters are null from VBS client
- Previous by thread: Re: Daylight Saving
- Next by thread: Re: VBScript added to Scheduled Task
- Index(es):