Program Watcher


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Program Watcher

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    36

    Program Watcher

    HI guys,

    A friend of mine works for a school and he has asked me if i could make a program for him, he wants it to look at what programs are running and if it is one that he has selected as not allowed he wants my program to give a message and shut it down.

    I have managed to code that part that looks for the program in the process list and then shuts it down with a message, that part was easy. The problem i have is how do i make my program sit in the background and only complain when their is a program that a student tries to start up which is not allowed? My program is not in focus or talked to by the other applications so how do i make it actively look?

    The language i use is VB6 on XP Pro

    many thanks

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX.

    A suggestion I have would be to have it sit in the system tray, and have your checker code get run from a timer that would fire at a preset interval.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Jun 2007
    Posts
    36
    oh ok i see.

    Is it possible for VB to look at what programs are launching, i don;t know what a technical term for that would be, so it is actually checking each entry into the application running list as they are being entered?

    thanks for the welcome, i am annoyed i have never found this site because it is really useful!

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I have produced lists of running process before in my apps. I'm sure I did much the same thing you are doing now.

    However, the only way I know of is to check what is currently running. I don't know of a way to check as soon as an application starts. I think it has to be in the task list before you know about it.

    Hopefully, however, someone will come a along and prove me wrong.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Jun 2007
    Posts
    36
    If i did decide to use a timer, what would be a good interval?

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    There is no way of knowing the optimum time. It would take some trial and error.

    I would suggest setting it high, running it, and just watching how it works.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    Jun 2007
    Posts
    36
    if you set it quite fast to 100 then it stops the program from launching near enough, and running some CPU test it doesn't seem to have a big impact - but is that good programming?

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by westweb
    but is that good programming?
    Does it work for you?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  9. #9
    Join Date
    Jun 2007
    Posts
    36

    server to client

    well it does.

    sorry to keep posting, i feel like i am wearing the forums out lol

    I have looked at most of the free code and there are still bits i can't understand. I would now like to extend the program so you can create a list of programs to be blocked on a server side version of the program (a database i imagine). Then all the client side programs can look at the database on the server and use the list of blocked programs, so there is no need to keep updating each client every time another piece of software needs to be blocked.

    But i don't know where to start, any help would be much appreciated as i am new to networking in VB.

    many thanks

Similar Threads

  1. soft drink Vending machine program
    By divagoddess in forum C++
    Replies: 5
    Last Post: 08-14-2009, 04:12 PM
  2. help, dont know why program is too slow
    By bob2000 in forum Java
    Replies: 1
    Last Post: 02-18-2007, 08:43 PM
  3. Connecting to a Server Program HELP
    By sedricbenson@ho in forum C++
    Replies: 2
    Last Post: 11-07-2006, 08:58 AM
  4. Please help with running executable vb program.
    By Gordon Reichhardt in forum VB Classic
    Replies: 2
    Last Post: 01-08-2002, 11:06 AM
  5. How can I build copy protection into my program
    By W.Pierce in forum VB Classic
    Replies: 1
    Last Post: 12-11-2001, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center