Enum processes, kill a process

J

Javier Ros

Hi,

I want to kill a specific process, but i haven´t the ProcessId,
how to enum the running processes in windows ce?

Thanks in advance.

Javier Ros Moreno
 
J

Javier Ros

Ok, I can kill a process now.

but when I kill "explorer.exe" process Iget this exception:
Fatal Application Error.
Application explorer.exe has performed an illegal operation and will be
shutdown. If the problem persists, contact the program vendor.

Program: explorer.exe
Exception: 0xC000001C
Address: 800855D4

This is my code:

Process[] procs = Process.GetProcesses();
Process procToKill = null;
foreach (Process proc in procs)
if (proc.ProcessName.ToLower() == "explorer.exe")
procToKill = proc;
if (procToKill != null)
procToKill.Kill();

Any ideas?

Thanks in advance.
 
P

Paul G. Tobey [eMVP]

Why would you try to do that? As in desktop Windows, killing Explorer sends
all kinds of other programs into the trash. The same is the case here.

Paul T.

Javier Ros said:
Ok, I can kill a process now.

but when I kill "explorer.exe" process Iget this exception:
Fatal Application Error.
Application explorer.exe has performed an illegal operation and will be
shutdown. If the problem persists, contact the program vendor.

Program: explorer.exe
Exception: 0xC000001C
Address: 800855D4

This is my code:

Process[] procs = Process.GetProcesses();
Process procToKill = null;
foreach (Process proc in procs)
if (proc.ProcessName.ToLower() == "explorer.exe")
procToKill = proc;
if (procToKill != null)
procToKill.Kill();

Any ideas?

Thanks in advance.


http://msdn.microsoft.com/library/d.../dnnetcomp/html/ProcessManager.asp?frame=true
 
J

Javier Ros

hmn...!
I want that user don´t have access to the taskbar and desktop items.
I don´t understand you when say:
"killing Explorer sends all kinds of other programs into the trash"

in my example exists 12 processes before kill "explorer.exe", after kill it
exists 11 processes, when my application terminate I relaunch "explorer.exe"
and is all right.


Paul G. Tobey said:
Why would you try to do that? As in desktop Windows, killing Explorer sends
all kinds of other programs into the trash. The same is the case here.

Paul T.

Javier Ros said:
Ok, I can kill a process now.

but when I kill "explorer.exe" process Iget this exception:
Fatal Application Error.
Application explorer.exe has performed an illegal operation and will be
shutdown. If the problem persists, contact the program vendor.

Program: explorer.exe
Exception: 0xC000001C
Address: 800855D4

This is my code:

Process[] procs = Process.GetProcesses();
Process procToKill = null;
foreach (Process proc in procs)
if (proc.ProcessName.ToLower() == "explorer.exe")
procToKill = proc;
if (procToKill != null)
procToKill.Kill();

Any ideas?

Thanks in advance.
http://msdn.microsoft.com/library/d.../dnnetcomp/html/ProcessManager.asp?frame=true
 
C

Chris Tacke, eMVP

killing explorer is a very, very, very, very bad idea. It's the entire
shell. If you want to lock down the device so it's a single-app use, why
not do it with the APIs created for doing so. You're not the first person
who wanted to do this, and there are plenty of examples out there on how to
do it properly.

Use google and look for things like "full screen app", "kiosk mode", "hide
start menu" and the like.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Javier Ros said:
hmn...!
I want that user don´t have access to the taskbar and desktop items.
I don´t understand you when say:
"killing Explorer sends all kinds of other programs into the trash"

in my example exists 12 processes before kill "explorer.exe", after kill it
exists 11 processes, when my application terminate I relaunch "explorer.exe"
and is all right.


Paul G. Tobey said:
Why would you try to do that? As in desktop Windows, killing Explorer sends
all kinds of other programs into the trash. The same is the case here.

Paul T.

Javier Ros said:
Ok, I can kill a process now.

but when I kill "explorer.exe" process Iget this exception:
Fatal Application Error.
Application explorer.exe has performed an illegal operation and will be
shutdown. If the problem persists, contact the program vendor.

Program: explorer.exe
Exception: 0xC000001C
Address: 800855D4

This is my code:

Process[] procs = Process.GetProcesses();
Process procToKill = null;
foreach (Process proc in procs)
if (proc.ProcessName.ToLower() == "explorer.exe")
procToKill = proc;
if (procToKill != null)
procToKill.Kill();

Any ideas?

Thanks in advance.


"Alex Yakhnin [MVP]" <[email protected]> escribió en el mensaje
http://msdn.microsoft.com/library/d.../dnnetcomp/html/ProcessManager.asp?frame=true
 
P

Paul G. Tobey [eMVP]

Well, that's not the way to achieve that. You can call SHFullScreen and/or
go through and disable he taskbar window, etc. to accomplish that (this is,
obviously, a frequently requested capability, so there are tons of past
messages talking about how to do it). There are too many things which the
shell provides to have it just go away. I'm not saying that killing
explorer causes the other processes to exit, but it *does* remove the
ability for the system to perform a number of critical functions, causing
exceptions, as you saw.

Paul T.

Javier Ros said:
hmn...!
I want that user don´t have access to the taskbar and desktop items.
I don´t understand you when say:
"killing Explorer sends all kinds of other programs into the trash"

in my example exists 12 processes before kill "explorer.exe", after kill it
exists 11 processes, when my application terminate I relaunch "explorer.exe"
and is all right.


Paul G. Tobey said:
Why would you try to do that? As in desktop Windows, killing Explorer sends
all kinds of other programs into the trash. The same is the case here.

Paul T.

Javier Ros said:
Ok, I can kill a process now.

but when I kill "explorer.exe" process Iget this exception:
Fatal Application Error.
Application explorer.exe has performed an illegal operation and will be
shutdown. If the problem persists, contact the program vendor.

Program: explorer.exe
Exception: 0xC000001C
Address: 800855D4

This is my code:

Process[] procs = Process.GetProcesses();
Process procToKill = null;
foreach (Process proc in procs)
if (proc.ProcessName.ToLower() == "explorer.exe")
procToKill = proc;
if (procToKill != null)
procToKill.Kill();

Any ideas?

Thanks in advance.


"Alex Yakhnin [MVP]" <[email protected]> escribió en el mensaje
http://msdn.microsoft.com/library/d.../dnnetcomp/html/ProcessManager.asp?frame=true
 
Joined
Feb 24, 2006
Messages
1
Reaction score
0
well..what if we just want to close all explorer windows programmatically?
I was able to close the control panel and other windows except for the explorer and command windows.

Thanks
SJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top