Re: How do you prevent a user from interfering with a GuiTest script?
- --- In email@example.com, "Eric" <eric_hansen85@y...>
> My experience using GuiTest with Microsoft Outlook is that theuser
> can touch their mouse or keyboard during execution of the GuiTestscript.
> script causing the intended path of the script to go off on a wild
> tangent performing menu options, etc. never intended by the
> How can this be prevented? Can the GuiTest script be programmedto
> disable the user's ability to send mouse and keyboard commands ofis
> their own (whether intentional or unintentional) until the script
> completed?There is a Win32 API call named 'BlockInput' that does what I
believe you wish to do. Here is a Perl fragment that demonstrates
my $blockhandle = Win32::API->new("user32", 'BOOL BlockInput(BOOL
#Call 'True' to that function (i.e block physical input)
my $block = $blockhandle->Call(1);
print "Keyboard/mouse locked (block returned $block)\n";
#Try moving mouse/typing now!
#Call 'False' to the function (i.e unblock physical input)
my $unblock = $blockhandle->Call(0);