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

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

Expand Messages
  • coolrobd
    That is all well and good but if you where typing in the main window and it was disabled, surely it would stop taking input from the keyboard therefore loosing
    Message 1 of 5 , Jul 19, 2004
    View Source
    • 0 Attachment
      That is all well and good but if you where typing in the main window
      and it was disabled, surely it would stop taking input from the
      keyboard therefore loosing what you have typed.

      The problem is that you need to be able to specify the window you
      want the text to appear and not rely on the set foreground window.


      --- In perlguitest@yahoogroups.com, "Stuart Arnold"
      <stuart.arnold@c...> wrote:
      > Just a thought, but its one I've done on an app that I run: disable
      the
      > main window.
      > That is, I start the process, get the app's main window id, and
      disable
      > it.
      > I don't gray it or anything else.
      >
      > -----Original Message-----
      > From: Dennis K. Paulsen [mailto:ctrondlpaulsden@y...]
      > Sent: Thursday, June 17, 2004 12:31 AM
      > To: perlguitest@yahoogroups.com
      > Subject: [perlguitest] Re: How do you prevent a user from
      interfering
      > with a GuiTest script?
      >
      >
      > This will more than likely require development effort to add into
      > Win32::GuiTest. If anyone would like to contribute, great.
      >
      >
      > Regards,
      > D
      >
      > --- 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
      >
      >
      >
      > Yahoo! Groups Sponsor
      >
      > ADVERTISEMENT
      >
      >
      <http://us.ard.yahoo.com/SIG=1290oqhk8/M=298184.5022502.6152625.300117
      6/
      >
      D=groups/S=1705006951:HM/EXP=1087533040/A=2164331/R=0/SIG=11eaelai9/*h
      tt
      > p://www.netflix.com/Default?mqso=60183351> click here
      >
      > <http://us.adserver.yahoo.com/l?
      M=298184.5022502.6152625.3001176/D=group
      > s/S=:HM/A=2164331/rand=984546876>
      >
      > _____
      >
      > Yahoo! Groups Links
      >
      >
      > * To visit your group on the web, go to:
      > http://groups.yahoo.com/group/perlguitest/
      >
      >
      > * To unsubscribe from this group, send an email to:
      > perlguitest-unsubscribe@yahoogroups.com
      > <mailto:perlguitest-unsubscribe@yahoogroups.com?
      subject=Unsubscribe>
      >
      >
      > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > Service <http://docs.yahoo.com/info/terms/> .
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
    • 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 2 of 5 , Aug 25, 2004
      View Source
      • 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.