The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: Re: NOW: Movies from hard disk WAS: VFD Questions


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [OT] - killing a windows process?


  • To: ukha_d@xxxxxxx
  • Subject: RE: [OT] - killing a windows process?
  • From: "Paul Gordon" <paul_gordon@xxxxxxx>
  • Date: Thu, 06 Mar 2003 22:41:47 +0000
  • Mailing-list: list ukha_d@xxxxxxx; contact ukha_d-owner@xxxxxxx
  • Reply-to: ukha_d@xxxxxxx

Ah right, thanks Steve,  - most helpful.

The circumstance when I want to kill Homeseer is when it has hung... (it
happens occasionally, especially as I keep running all the new beta's!)

I have written a VB app that monitors Homeseer and detects when it is not
responding any more. When the whole thing has terminated, there's no
problem, but sometimes homeseer just hangs, and the process is still
present
as a task, - in this circumstance, a new instance of Homeseer can't be
started, as it says "Homeseer is already running"

I also have a hardware watchdog in development that runs on an Ocelot, and
resets the PC by depressing its reset button, however, that is sometimes a
bit drastic when Windows is still OK, and it's only the homeseer
application
that has faulted. I'd rather have a "softer" watchdog option that
leaves
Windows alone and just manages Homeseer... (don't like whipping the legs
out
>from
necessary...).

The "soft" watchdog runs on a 60 second probe cycle. and the
Ocelot hardware
watchdog will be on a 10-minute cycle, so in theory the soft option should
always have an opportunity to solve any hangs first, but if that fails then
the hard option will reboot the PC 10 mins later...


Paul G.






>From: "Steve Morgan" <steve@xxxxxxx>
>Reply-To: ukha_d@xxxxxxx
>To: <ukha_d@xxxxxxx>
>Subject: RE: [ukha_d] [OT] - killing a windows process?
>Date: Thu, 6 Mar 2003 18:30:52 -0000
>
>I recently wrote a .NET wrapper for Wserver that I used monitor it and
>kill it if necessary. It was particularly easy because I launched it
>from the wrapper and consequently had a reference to the Process. The
>.NET Framework makes it all rather trivial.
>
>Previously, I've done it using the Win32 API, but I've given it up as a
>mugs game ;-)
>
>In what circumstances do you want to kill HomeSeer?
>
>If you just want to close the app, you can use FindWindow, and post a
>WM_CLOSE message. However, if you want to kill it (perhaps because it's
>hung), you need to FindWindow (or iterate through the windows),
>GetWindowThreadProcessId to get the process ID and terminate the
process
>with TerminateProcess. It's always best to try the WM_CLOSE method
>first, then kill the process if it doesn't respond.
>
>Cheers,
>Steve
>
>
>
> > -----Original Message-----
> > From: Paul Gordon [mailto:paul_gordon@xxxxxxx]
> > Sent: 06 March 2003 16:39
> > To: ukha_d@xxxxxxx
> > Subject: [ukha_d] [OT] - killing a windows process?
> >
> >
> > Question for the win32 programmers among us...
> >
> > (Oh, and the process I want to kill is homeseer.exe, so it's
> > not *totally*
> > OT...)
> >
> > Anyone know how to programatically kill a running process
> > under Windows (XP
> > in this case...). I need to be able to be certain that the
> > process has been
> > terminated completely, just as surely as if I use the task
> > manager GUI and
> > use the "End Process" button...
> >
> > My initial thoughts have been...
> >
> > a) Use the Resource Kit "Kill" utility, - but this is a
bit
> > of a bodge as
> > I'd have to shell out to run it...
> >
> > b) Use the Win32 API directly, this would be my preferred
> > method, but I
> > don't know what call I need, or how to call it from VB. (or
> > even if that is
> > possible?)  I'm guessing I need the WM_CLOSE API call? Bear
> > in mind that I
> > don't know the process ID, so I also need to enumerate that
> > at run-time...
> >
> > Any ideas/suggestions?  - code snippets... :-)
>
>
>
>http://www.automatedhome.co.uk
>Post message: ukha_d@xxxxxxx
>Subscribe:  ukha_d-subscribe@xxxxxxx
>Unsubscribe:  ukha_d-unsubscribe@xxxxxxx
>List owner:  ukha_d-owner@xxxxxxx
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


_________________________________________________________________
Stay in touch with MSN Messenger http://messenger.msn.co.uk


http://www.automatedhome.co.uk
Post message: ukha_d@xxxxxxx
Subscribe:  ukha_d-subscribe@xxxxxxx
Unsubscribe:  ukha_d-unsubscribe@xxxxxxx
List owner:  ukha_d-owner@xxxxxxx

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.