Cannot terminate a process. 
Author Message
 Cannot terminate a process.

Hi, folks.

I encountered a problem about terminating a process I created. I created a
process using "CreateProcess" and pass the "C:\WINNT\explorer.exe D:\" as
the second parameter to this call. The explorer runs well. But when I tried
to close this process using "TerminateProcess", it returned FALSE! How can I
close a process I created before?

Thanks.

Regards.

Jeff



Fri, 15 Apr 2005 17:17:33 GMT  
 Cannot terminate a process.
My guess would be that one instance of explorer.exe always runs and if you
spawn a new explorer window it really does not spawn a new process (rather
the current process just brings up another top level window). Thus you might
not be able to terminate it at all! Again, this is my guess. You'd probably
want to test this out further.

--
Regards,
Nish [Visual C++ MVP]


Quote:
> Hi, folks.

> I encountered a problem about terminating a process I created. I created a
> process using "CreateProcess" and pass the "C:\WINNT\explorer.exe D:\" as
> the second parameter to this call. The explorer runs well. But when I
tried
> to close this process using "TerminateProcess", it returned FALSE! How can
I
> close a process I created before?

> Thanks.

> Regards.

> Jeff



Sat, 16 Apr 2005 02:24:18 GMT  
 Cannot terminate a process.
Hi, Nish, thanks.

I also think so. I guess that CreateProcess(.., _T
("C:\WINNT\explorer.exe D:\",....) create a process which
creates another process to run the "explorer.exe". I ever
tried to use PostThreadMessage but always failed.

I wonder is there any way out to get "parent process id"
of a process? Just now I read some posts in google and
found someone said that there is no such "parent-child"
relationship between process after the so-called "child"
process is created. So it seems that it'll be really hard,
even impossible, to terminate the "C:\WINNT\explorer.exe
D:\" process. :(

Regards.
Jeff

Quote:
>-----Original Message-----
>My guess would be that one instance of explorer.exe

always runs and if you
Quote:
>spawn a new explorer window it really does not spawn a
new process (rather
>the current process just brings up another top level

window). Thus you might
Quote:
>not be able to terminate it at all! Again, this is my

guess. You'd probably
Quote:
>want to test this out further.

>--
>Regards,
>Nish [Visual C++ MVP]



>> Hi, folks.

>> I encountered a problem about terminating a process I

created. I created a
Quote:
>> process using "CreateProcess" and pass

the "C:\WINNT\explorer.exe D:\" as
Quote:
>> the second parameter to this call. The explorer runs
well. But when I
>tried
>> to close this process using "TerminateProcess", it

returned FALSE! How can
Quote:
>I
>> close a process I created before?

>> Thanks.

>> Regards.

>> Jeff

>.



Sat, 16 Apr 2005 03:34:54 GMT  
 Cannot terminate a process.
Send WM_CLOSE to the main frame window.

Ruben

Quote:

>Hi, Nish, thanks.

>I also think so. I guess that CreateProcess(.., _T
>("C:\WINNT\explorer.exe D:\",....) create a process which
>creates another process to run the "explorer.exe". I ever
>tried to use PostThreadMessage but always failed.

>I wonder is there any way out to get "parent process id"
>of a process? Just now I read some posts in google and
>found someone said that there is no such "parent-child"
>relationship between process after the so-called "child"
>process is created. So it seems that it'll be really hard,
>even impossible, to terminate the "C:\WINNT\explorer.exe
>D:\" process. :(

>Regards.
>Jeff

>>-----Original Message-----
>>My guess would be that one instance of explorer.exe
>always runs and if you
>>spawn a new explorer window it really does not spawn a
>new process (rather
>>the current process just brings up another top level
>window). Thus you might
>>not be able to terminate it at all! Again, this is my
>guess. You'd probably
>>want to test this out further.

>>--
>>Regards,
>>Nish [Visual C++ MVP]



>>> Hi, folks.

>>> I encountered a problem about terminating a process I
>created. I created a
>>> process using "CreateProcess" and pass
>the "C:\WINNT\explorer.exe D:\" as
>>> the second parameter to this call. The explorer runs
>well. But when I
>>tried
>>> to close this process using "TerminateProcess", it
>returned FALSE! How can
>>I
>>> close a process I created before?

>>> Thanks.

>>> Regards.

>>> Jeff

>>.



Sat, 16 Apr 2005 08:09:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Program cannot terminated, please help ?

2. Terminating a child process

3. Process suddenly terminates without notification

4. terminate process

5. Debugged Process will not Terminate under Win2K

6. Process suddenly terminates without notification

7. Terminate Process and SecurityIno ?

8. Find and terminate a process under WIN98

9. How to terminate a process

10. terminating an out of process application

11. Terminate process (WaitableTimer)

12. terminate or Exit process, need help!

 

 
Powered by phpBB® Forum Software