Click here to Skip to main content
16,004,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
arnold_w21-Oct-08 0:48
arnold_w21-Oct-08 0:48 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
leppie21-Oct-08 0:51
leppie21-Oct-08 0:51 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
arnold_w21-Oct-08 0:58
arnold_w21-Oct-08 0:58 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
Simon P Stevens21-Oct-08 0:58
Simon P Stevens21-Oct-08 0:58 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
arnold_w21-Oct-08 1:01
arnold_w21-Oct-08 1:01 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
Simon P Stevens21-Oct-08 1:07
Simon P Stevens21-Oct-08 1:07 
GeneralRe: How can I programmatically generate OnDrawItem events for a ComboBox? Pin
leppie21-Oct-08 3:20
leppie21-Oct-08 3:20 
QuestionKilling a Process Pin
Vimalsoft(Pty) Ltd20-Oct-08 22:38
professionalVimalsoft(Pty) Ltd20-Oct-08 22:38 
Good Morning

i have written something to kill a Process based on the Supplied parameter. Here is the Code

I created a Class that will Contain my Function like this
namespace Process_Killer
{
    public class Process_Killer
    {
        //Namespaces needed


        public bool FindAndKillProcess(String name)
        {
            Boolean Bolres = false;

            Process clsProcess = new Process();


                if (clsProcess.ProcessName.Contains(name))
                {
                    //since we found the proccess we now need to use the
                    //Kill Method to kill the process. Remember, if you have
                    //the process running more than once, say IE open 4
                    //times the loop thr way it is now will close all 4,
                    //if you want it to just close the first one it finds
                    //then add a return; after the Kill
                    clsProcess.Kill();
                    //process killed, return true
                    Bolres = true;
                }
                else
                {
                    Bolres = false;
                }
                return Bolres;
            }


        }
    }


And after that i have a Win App , that will pass the name of the Process and in the kill button am calling the function that i created above like this


Boolean Bolres = false;

           String Processname = txtProcessname.Text;


           Process_Killer objProcesskiller = new Process_Killer();


           Bolres = objProcesskiller.FindAndKillProcess(Processname);

           if (Bolres == true)
           {
               MessageBox.Show("Process Killed", "Process Killer");
           }
           else
           {
               MessageBox.Show("Process not Found, Do not include the Process Extension", "Process Killer");
           }


And when i run this app , i get the Error

No process is associated with this object.


Thank you

Vuyiswa Maseko,

Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding

VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za


AnswerRe: Killing a Process Pin
Simon P Stevens20-Oct-08 22:51
Simon P Stevens20-Oct-08 22:51 
AnswerRe: Killing a Process Pin
Vimalsoft(Pty) Ltd21-Oct-08 20:03
professionalVimalsoft(Pty) Ltd21-Oct-08 20:03 
QuestionHow to alter the main GUI from another class/object? Pin
munk1220-Oct-08 21:55
munk1220-Oct-08 21:55 
AnswerRe: How to alter the main GUI from another class/object? Pin
leppie20-Oct-08 21:57
leppie20-Oct-08 21:57 
GeneralRe: How to alter the main GUI from another class/object? Pin
munk1221-Oct-08 23:42
munk1221-Oct-08 23:42 
QuestionPlease help with Drag and Drop Pin
User 543536420-Oct-08 21:25
User 543536420-Oct-08 21:25 
Questionhow i can Create Iphone application Pin
wasimsharp20-Oct-08 20:14
wasimsharp20-Oct-08 20:14 
AnswerRe: how i can Create Iphone application Pin
Ed.Poore20-Oct-08 21:23
Ed.Poore20-Oct-08 21:23 
GeneralRe: how i can Create Iphone application Pin
wasimsharp20-Oct-08 23:22
wasimsharp20-Oct-08 23:22 
AnswerRe: how i can Create Iphone application Pin
Simon P Stevens20-Oct-08 22:33
Simon P Stevens20-Oct-08 22:33 
Questionchange IP Pin
Hossein Afyuoni20-Oct-08 20:11
Hossein Afyuoni20-Oct-08 20:11 
AnswerRe: change IP Pin
Ed.Poore20-Oct-08 21:22
Ed.Poore20-Oct-08 21:22 
QuestionHow to Implement Context-Sensitive Help in .NET Applications Created with C#, Pin
tozy20-Oct-08 19:52
tozy20-Oct-08 19:52 
AnswerRe: How to Implement Context-Sensitive Help in .NET Applications Created with C#, Pin
Giorgi Dalakishvili20-Oct-08 20:10
mentorGiorgi Dalakishvili20-Oct-08 20:10 
Questionxmlrpc for .net cf... Pin
l a u r e n20-Oct-08 18:24
l a u r e n20-Oct-08 18:24 
AnswerRe: xmlrpc for .net cf... Pin
Ed.Poore20-Oct-08 21:24
Ed.Poore20-Oct-08 21:24 
QuestionHow to crop PictureBox Image when Stretched? Pin
saberbladez20-Oct-08 15:59
saberbladez20-Oct-08 15:59 

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.