Click here to Skip to main content
15,905,967 members
Home / Discussions / C#
   

C#

 
GeneralRe: Close all application using c# Pin
SeMartens28-Jan-09 22:53
SeMartens28-Jan-09 22:53 
GeneralRe: Close all application using c# [modified] Pin
charles henington12-May-10 18:44
charles henington12-May-10 18:44 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot28-Jan-09 22:59
Ankit Rajpoot28-Jan-09 22:59 
AnswerRe: Close all application using c# Pin
SeMartens28-Jan-09 21:43
SeMartens28-Jan-09 21:43 
GeneralRe: Close all application using c# Pin
sandhya1428-Jan-09 22:17
sandhya1428-Jan-09 22:17 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot28-Jan-09 22:27
Ankit Rajpoot28-Jan-09 22:27 
GeneralRe: Close all application using c# Pin
sandhya1429-Jan-09 20:04
sandhya1429-Jan-09 20:04 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot29-Jan-09 21:01
Ankit Rajpoot29-Jan-09 21:01 
Hi Sandhya,

The reason you're getting that shutdown window is that the GetProcesses method gets a list of all running processes on the local computer or the machine name specified as an argument, and this list includes explorer as well. So when you call CloseMainWindow(), the close signal is being sent to all running programs including explorer as well. You should do like given below:

Process[] processlist = Process.GetProcessesByName("Notepad");

foreach (Process theprocess in processlist)
{
theprocess.CloseMainWindow();
}


All the best

Excuse me for buttin' in, but I'm interrupt driven.

GeneralRe: Close all application using c# Pin
sandhya1429-Jan-09 21:12
sandhya1429-Jan-09 21:12 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot29-Jan-09 21:22
Ankit Rajpoot29-Jan-09 21:22 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot29-Jan-09 21:49
Ankit Rajpoot29-Jan-09 21:49 
GeneralRe: Close all application using c# Pin
sandhya1429-Jan-09 23:27
sandhya1429-Jan-09 23:27 
GeneralRe: Close all application using c# Pin
Ankit Rajpoot30-Jan-09 2:14
Ankit Rajpoot30-Jan-09 2:14 
QuestionProblem with C# not with VB6 Application Pin
Sun Rays28-Jan-09 21:12
Sun Rays28-Jan-09 21:12 
AnswerRe: Problem with C# not with VB6 Application Pin
Ankit Rajpoot28-Jan-09 21:24
Ankit Rajpoot28-Jan-09 21:24 
GeneralRe: Problem with C# not with VB6 Application Pin
Sun Rays28-Jan-09 21:51
Sun Rays28-Jan-09 21:51 
Questionurl rewriting [modified] Pin
icanmakeiteasy28-Jan-09 20:19
icanmakeiteasy28-Jan-09 20:19 
AnswerRe: url rewriting Pin
Spunky Coder28-Jan-09 20:51
Spunky Coder28-Jan-09 20:51 
QuestionHow to run appllication by checking MAC address of a system Pin
sandhya1428-Jan-09 19:27
sandhya1428-Jan-09 19:27 
AnswerRe: How to run appllication by checking MAC address of a system Pin
Spunky Coder28-Jan-09 20:02
Spunky Coder28-Jan-09 20:02 
GeneralRe: How to run appllication by checking MAC address of a system Pin
sandhya1428-Jan-09 20:10
sandhya1428-Jan-09 20:10 
GeneralRe: How to run appllication by checking MAC address of a system Pin
Spunky Coder28-Jan-09 20:46
Spunky Coder28-Jan-09 20:46 
GeneralRe: How to run appllication by checking MAC address of a system Pin
sandhya1428-Jan-09 21:01
sandhya1428-Jan-09 21:01 
GeneralRe: How to run appllication by checking MAC address of a system Pin
Spunky Coder28-Jan-09 21:09
Spunky Coder28-Jan-09 21:09 
GeneralRe: How to run appllication by checking MAC address of a system Pin
sandhya1428-Jan-09 21:17
sandhya1428-Jan-09 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.