Re: determine invalid window process



"X. Zhang" <XZhang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:49B8D775-E7CA-4EBF-BB34-C08416125192@xxxxxxxxxxxxxxxx
I encountered a strange problem. I have an VB6 Form application. Sometimes,
for some reasons, say crashing, the application stays in the memory (can
be
seen in Processes list of Task Manager), but it cannot be activated, and
cannot "Switch to" using Task Manager, even though the call FindWindow
DOES
return the window handle. (I call it ghost.) I'm able to kill the ghosts
AND
OTHERS from other application, but I do NOT want to kill the innocent
(normal
status, that is, window can be activated). So my question, how to
determine
the GHOST window application like this?

Thanks in advance.

The window is not gone, just hidden. Since you were able to use FindWindow,
use IsWindowVisible() to if the window is hidden, then use
GetWindowThreadProcessId() to get the process ID, then use
OpenProcess/TerminateProcess/CloseHandle to terminate it.

This can be a normal behavior for some applications so you don't kill every
application that has a hidden window. Some examples include tray
applications.

If the title changes often, google FindWindowLike() to get hWnd.


.



Relevant Pages

  • Re: Has somebody made a surveillance thread which doesnt die?
    ... If somebody kills your "manager" app from the task manager I think it ... it kills another window by it's name and then it exits. ... kill the other window and then exit. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: determine invalid window process
    ... cannot "Switch to" using Task Manager, even though the call FindWindow DOES ... but I do NOT want to kill the innocent (normal ... status, that is, window can be activated). ... the GHOST window application like this? ...
    (microsoft.public.vb.winapi)
  • Re: Task Manager window in XP Home
    ... Sounds like the Task Manager is in "Tiny Footprint" mode. ... the border area of the Task Manager, and all the tabs etc. should return. ... > This means that if I need to kill a rogue application, ... as I don't have a window with the normal controls ...
    (microsoft.public.windowsxp.general)
  • Task Manager window in XP Home
    ... When I hit ctl-alt-del to bring up the Task Manager, ... This means that if I need to kill a rogue application, ... as I don't have a window with the normal controls surrounding ...
    (microsoft.public.windowsxp.general)
  • Re: yesterday, Otto never believes until Charlie receives the ugly can totally
    ... Yesterday, go kill a shopkeeper! ... window is too blunt for Carol to look it. ... comb Rosalind, and they halfheartedly love Ricky too. ...
    (rec.pets.cats.anecdotes)

Loading