Loading ...
Sorry, an error occurred while loading the content.

Re: How do you prevent a user from interfering with a GuiTest script?

Expand Messages
  • Michael Rabinovitz
    ... user ... script. ... to ... is ... There is a Win32 API call named BlockInput that does what I believe you wish to do. Here is a Perl fragment that
    Message 1 of 5 , Aug 25 5:16 PM
    • 0 Attachment
      --- In perlguitest@yahoogroups.com, "Eric" <eric_hansen85@y...>
      wrote:
      > My experience using GuiTest with Microsoft Outlook is that the
      user
      > can touch their mouse or keyboard during execution of the GuiTest
      > script causing the intended path of the script to go off on a wild
      > tangent performing menu options, etc. never intended by the
      script.
      > How can this be prevented? Can the GuiTest script be programmed
      to
      > disable the user's ability to send mouse and keyboard commands of
      > their own (whether intentional or unintentional) until the script
      is
      > completed?
      >
      > Eric

      There is a Win32 API call named 'BlockInput' that does what I
      believe you wish to do. Here is a Perl fragment that demonstrates
      its use:

      my $blockhandle = Win32::API->new("user32", 'BOOL BlockInput(BOOL
      in)' );

      #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!
      sleep 15;

      #Call 'False' to the function (i.e unblock physical input)
      my $unblock = $blockhandle->Call(0);

      Good Luck
      Mike Rabinovitz
    Your message has been successfully submitted and would be delivered to recipients shortly.