Ken Dibble wrote:
>>Why not check the running processes for your executable, combined with >>the window title search? Your program would have all the info it needs >>to make a "smart" decision, keeping the user from losing hair. > > I've never seen an example of code that could find a running process and > terminate it without relying on the window title search. I have tried very > hard to find one. Is there such a beast? Can you point me to a URL or > something? I'd be much obliged.
I don't know about specific code, however on the WinXP commandline there are 2 applications available that would provide the basic ingredients:
tasklist (known as tlist prior to xp) kill
You could parse the output of tasklist, calling kill on the process(es) you've identified.
There are also the windows api functions which I'm too lazy to look up right now.
> At least in my field, which is mostly about providing social services, and > only marginally about computer operation, and where it is impossible to > enforce any minimum computer literacy requirements in job descriptions even > if we put them in there, it's better not to give users opportunities to > confuse themselves.
I hear you. I remember what it was like when users weren't so skilled as they are these days in the corporate world.
-- pkm ~ http://paulmcnett.com
©2007 Paul McNett |