Hi:
I have tried using that but I get an error message.
  The Application Object in use is in:
  System.Window.Forms.Application not the
  System.Windows.Application Class.
  Here is the error when I hard code
  System.Windows.Application.Current.ShutDown()
  Error 1 'Application' is not a member of 'Windows'. 
c:\VBNet2010Script\VBNet2010Script\LaunchApp.vb 65 1 VBNet2010Script
  When I just use Application.Current.Shutdown()
  It tells me Current is not a member of the System.Windows.Forms.Application 
class.
  I am not sure the ShutDown command can be used with a Winforms Project or, at 
least, not one set up the way this one is set up.
  Thanks though and I did try it before and again just now to verify the 
results.
  I am not sure how much documentation I will be able to provide. This is 
getting quite complicated indeed.
  My first problem is that when I click on the shortcut to start vb.net 2010 
express WindowEyes says nothing at all.
  Alt Tabbing doesn't help since it takes a few seconds for vb.net to load and 
get ready for work.
  Even after loading WindowEyes says nothing.
  So:
  I put a message in the script that vb.net is loading and another message when 
it is done and ready for work.
  I also will try and set the focus to one of the buttons on the Start Page and 
read that button so things sound good and solid when I click the shortcut from 
the DeskTop.
  It is working but I will muck with setting focus tomorrow, dinnertime my wife 
tells me.
  Rick USA
  .if it comes up.

  Rick USA
  ----- Original Message ----- 
  From: Katherine Moss 
  To: [email protected] 
  Sent: Monday, May 07, 2012 8:51 PM
  Subject: RE: Visual Studio Express Accessibility


  And whatever you do get running, you should post up on app central for the 
rest of us who are interested.  

   

  From: Chip Orange [mailto:[email protected]] 
  Sent: Monday, May 07, 2012 8:18 PM
  To: [email protected]
  Subject: RE: Visual Studio Express Accessibility

   

  Hi again Rick,

   

  congrats and thanks for working on this.

   

  I hope you saw Jamal's post on how to shutdown a winforms .net app using 
Application.Current.Shutdown()?  It certainly would be better to shut it down 
than to "kill" the process, and this looks like he's put his finger on the 
technique.  I think it would be worth a wiki article if you develop an external 
app, and have this tip to pass along to others (along with other advice on 
getting one running).

   

  Chip

   

     


----------------------------------------------------------------------------

    From: RicksPlace [mailto:[email protected]] 
    Sent: Monday, May 07, 2012 4:50 AM
    To: [email protected]
    Subject: Re: Visual Studio Express Accessibility

    Hi Chip, Jamal et al:

    Chip

      That is correct. It was hard to explain the script was created in vb.net 
2008 express for vb.net 2010 Express.

      To shut the script down I had to shut down a Project (the script) using 
the tools available to a vb.net project since the executable 
(VBNet2010Script.exe) was created in vb.net 2008 express.

      Perhaps I did not make this clear in one of the posts, could be.

      But you are correct, I wanted to shut down only the script and not the 
IDE itself.

      Jamal: I will be glad to post up the HarvestWindow output and the WinDig 
output now that I am getting back to working with the script and not on trying 
to shut it down gracefully, which was seemingly not possible.

      I am pretty sure there are things I can do to make the Express Versions a 
little nicer to work with and since you guys are Gurus with Windows Programming 
you might have ideas and solutions I dont know and dont know I dont know if 
that makes sense.

      Kate, I forget the ModuleName but the problem was that it was the same 
for both vB.net 2008 Express and for VB.net 2010 Express and WindowEyes uses 
the ModuleName to associate a script with a Target Application so my script was 
firing for both versions when I want it firing for only the vb.net 2010 Express 
version.

      Finally, Application.Exit did not shut down the script so I was trying 
all other methods of shutting it down gracefully but only the Killing of the 
Running Process worked to stop the script in WindowEyes ScriptManager.

      The discussion about using a Form was because that is the normal way a 
Winforms Project is shut down and handles all the cleanup and finalization 
automatically.

      It also works correctly with WindowEyes to stop the script in the 
WindowEyes ScriptManager.

      The Script did not need a Form so I did not want to use a Dummy Form - 
not graceful but may be the best method in the long run unless WindowEyes can 
recognize a shutdown request via Application.Exit.

      Actually WindowEyes recognizes it and fires the appropriate call back but 
does not terminate the calling thread so WindowEyes keeps the Thread Running 
and Script Manager does not reflect the attempted termination.

      Note that Application,.exit does not force a shutdown so this may, or 
not, be the correct behavior for WindowEyes to follow - that is beyond my 
Windows Programming understanding and not necessary to get the job done at this 
point.

      So, I will leave any discussion about that to the Windows  gurus and 
Software Programmers and Engineers.

      There are not enough people working with External, Managed Code scripts 
to merrit more discussion of this on list from a piker like me.

      So that's it for this thread for now.

      Kill is working and ok for this particular script so far but I may use a 
dummy Form in the future if it gets more complex.

      I will likely post other threads about the Analysis process and what can 
be done with the available tools.

      So, I think that's all I have on this thread.

      Thanks for the great discussion and I look forward to upcoming threads 
where I can learn more by reading, experimenting and asking questions.

      Rick USA

      ----- Original Message ----- 

      From: Chip Orange 

      To: [email protected] 

      Sent: Saturday, May 05, 2012 3:44 PM

      Subject: RE: Visual Studio Express Accessibility

       

      Rick,

       

      I see no reason why you need to kill the visual studio IDE process 
itself?  You only need to stop your own script.  A script never tries to stop 
the process/program which it is related to.

       

      Chip

       

         


------------------------------------------------------------------------

        From: RicksPlace [mailto:[email protected]] 
        Sent: Saturday, May 05, 2012 6:43 AM
        To: [email protected]
        Subject: Visual Studio Express Accessibility

        Hi:

        I was looking into shutting down a Process from within VB.net Express.

        To ensure all Child-processes are shut down it appears folks usually 
use something called the EnvDTE object.

        This object also gives access to the running Process so you can do 
things like click a button or change text in a TextBox from another Process 
like a  WindowEyes Script.

        According to a member of the Microsoft Staff, a posting in a Blog, the 
Express Versions do not expose the EnvDTE Object to third party applications 
like a WindowEyes script.

        This was a quote Business decission on the part of Microsoft.

        This hampers using UIA, MSAA or any other method I know of to make the 
Express versions of Visual Studio much more accessible than they are already.

        It also has thrown a monkey wrench into my plan to Kill the running 
Process since Visual Studio, and I assume the Express versions, spawn other 
processes that may be left hanging and running if the Main Process is Killed 
without due process to the child processes if I read it correctly.

        I can still make some things much more readable with UIA, MSAA and the 
WE Object Model but not do much, if anything, that requires information from 
the Underlying Visual Studio controls or any interaction with them via a script.

        At least that is my understanding of the problem so far.

        Since Application.Exit doesnt work, it handles clean up and shut down 
messages while kill doesn't,perhaps the shut down of a dummy form will work as 
Aaron used in his original example.

        I either have to find a way to work around a focus problem using a 
dummy window if I can, figure out why Application.Exit doesn't work or find 
another method of shutting the script down ensuring no objects or processes are 
left     hanging.

        I hope Microsoft knows this decission sucks for blind users of their 
free Express Versions of Visual Studio that work  extremely well for sighted 
users.

        Later and I will be able to do a few things even without this missing 
feature in the Visual Studio Express versions.

        Rick USA

Reply via email to