Hi Rick,

    Remember that one question about the form and the need to call that process 
I had given to you when you had asked why there were 2 different types. 
    It looks like you are going to have to make a form according to what I 
found and Chip later gave the thread link and I then posted the explanation.
        Bruce

  Sent: Sunday, May 06, 2012 11:46 AM
  Subject: Re: Stopping An External Script


  Hi Chip:
  I have tried most everything to shut down gracefully from within the script 
itself without closing down the Target application.
    The only thing that has worked so far is to kill the process as Aaron had 
suggested.
    When I do an Application.Exit the ClientInformation On Close Event fires 
and the sub I have for that event is executed but then the Script is still 
running.
    That tells me that the Application.Exit is working to send WindowEyes the 
information, the ClientInformation recognizes it and calls back into the Event 
handler but after that something is missing since the script does not stop.
    I do want to get back to fumbling around with UIA so will ride the Kill 
method until I feel like trying to add a form and using that to handle starting 
and stopping of the script.
    Other than that I would have to look into how messages are processed 
between threads and see if I can send the right one to the WindowEyes calling 
thread or set the proper system codes and variables if WindowEyes checks them, 
just dont know.
    Later.
    Rick USA
    ----- Original Message ----- 
    From: Chip Orange 
    To: [email protected] 
    Sent: Friday, May 04, 2012 8:55 PM
    Subject: RE: Stopping An External Script


    Hi Rick,

    I think you were asking how do you prevent your script from running while 
you try to work this out, because you don't want it to run?  If that's it, you 
can go into app manager and highlight your script and use the alt-e 
(enable/disable) option and disable the script.  This will stop it from 
launching in the future, and will also send your external script the onShutdown 
event (I believe); if your script isn't responding properly to that, you may 
have to kill it via task manager (or there's some indication WE will eventually 
kill it, but they suggest you don't rely on that).


    I think stopScript is only useful for VBScript scripts.

    You've probably seen this, but check out the wiki article at:
    
http://www.gwmicro.com/mediawiki/index.php?title=Internal_and_External_Scripts&t=20091224192759
    ("Internal and External scripts")

    to be reminded of how WE expects external scripts to function.

    I'm sure you'll figure out the application.exit() problem, but it isn't 
anything being caused by WindowEyes; once WE has started your script running, 
it doesn't do anything directly to keep it running.

    At least, that's my understanding.

    hth,

    Chip






--------------------------------------------------------------------------
      From: RicksPlace [mailto:[email protected]] 
      Sent: Friday, May 04, 2012 8:05 AM
      To: [email protected]
      Subject: Stopping An External Script


      Hi:
      I am creating a script in VB.net 2008 for VB.net 2010.
      I check the ProductName and attempt to close the script if it is not 
vb.net 2010 which opened it.
      The Application.Exit() fires ok but the script is not stopped.
      So:
      I open vb.net 2008 to do some editing on the vbnet2010script, the 
ModuleName is something like VBNetExpress which is the same as it is in vb.net 
2010.
      WindowEyes sees the VBNet module name and starts the vb.net 2010 script:
      In the vb.net 2010 script I check for the ProductName containing 2010:
      Since it contains 2008 I execute Application.Exit()
      I go into WE ScriptManager and the  vb.net 2010 Script is not stopped.
      How do I stop the script without closing the vb.net 2008 IDE?
      Is there some way of preventing WE from opening it in the first place?
      What about killing the script process?
      If not sure I will experiment but if there is a means of doing this like 
the StopScript command in the script object that would be cleaner and more 
efficient, especially if done before the script loads.
      Rick USA

Reply via email to