Hi Rick,
Does your VB.NET pprogram terminate if it is run independently, rather
than as a Window-Eyes app?
In general, it is the responsibility of an app to terminate itself,
rather than Window-Eyes. An external app should register itself with
Window-Eyes so that Window-Eyes can react appropriately when the app
closes, but it is the app that is doing the closing, not Window-Eyes in
that case. Registering the app (by notifying Window-Eyes of its process
ID) does also allow Window-Eyes to stop an app forcefully if the user
makes that choice via the Window-Eyes user interface. Doing so is not
normal practice, however, for a properly designed app.
Have you tried the following code I suggested to close your VB.NET app?
Application.Current.Shutdown()
Jamal
On 5/7/2012 4:49 AM, RicksPlace wrote:
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 <mailto:[email protected]>
*To:* [email protected] <mailto:[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] <mailto:[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