Stopping applications from running

I need to write a small application that will stop other applications from running. For example, I dont want NotePad to run on a specific machine. How can I chain in the OS to find out what is being run, and then abort it

Thanks

Ralph Krausse



Answer this question

Stopping applications from running

  • rwright142

    Thanks, that is good but I didn't make my previous post clear enough. Is there a way hook into the process list (like a mouse hook or a keyboard hook) and have the OS notify me of a starting process

    r-


  • Targe309404

    See, I wrote the managed way to do this.......

    In my knowledge, there is not built in implementation of this feature in FCL upto 2.0 Framework.

    But your example is right there me be some hook type technique to detect application initialization but sorry I never listened or read about this. If you get any solution please also inform me right in this post.

    Best of Luck ;)



  • ION T

    The managed way to do this in my Opinion is to query the running applications after a short interval from your application (Better Be Windows Service) using;

    Process [] pByName = Process.GetProcessesByName("notepad", "127.0.0.1");

    or

    Process [] pByName = Process.GetProcessesByName("notepad", "ComputerName");

    if(pByName > 0)

    {

            for(int i = pByName.length-1; i > 0; i--)

                   {

                             pByName[ i ].Kill();

                   }

    }



  • Stopping applications from running