Re: determine invalid window process
- From: "expvb" <nobody@xxxxxxx>
- Date: Sat, 26 Jul 2008 15:57:43 -0400
"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.
.
- Prev by Date: send message to inactive window
- Next by Date: Re: send message to inactive window
- Previous by thread: Re: determine invalid window process
- Next by thread: Re: determine invalid window process
- Index(es):
Relevant Pages
|
Loading