There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer bios black screen blue screen boot computer connection crash css dell display driver drivers email error firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router security slow software sound sprtcmd.exe trojan usb virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Process Hook in VB6


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
ThoughT's Avatar
Computer Specs
Member with 94 posts.
 
Join Date: Aug 2004
Location: Ontario, Canada
Experience: Advanced
30-Oct-2005, 05:33 AM #1
Process Hook in VB6
Hello, I've been programming in several languages for several years but havn't really played with VB much but I'd like to make this program with VB, I have version 6

anyways I am developing this program that keeps tabs on all the running processes and makes sure they're all good, (have a allow and kill list, and if the process is on the kill list it gets killed.. ..good for stoping spyware and perhaps virai)

for the program to be efficient I think I need to use some form of hook that gets called each time a new process is created, instead of having my program refresh the process list frequently to check for new processes and have to compare each individual process to the lists to check to see if it should die.

does anyone know of a hook or something in which I can use to do this?

thank you very much in advance for any form of help.

ThoughT
aewarnick's Avatar
Senior Member with 839 posts.
 
Join Date: Sep 2002
30-Oct-2005, 06:32 PM #2
Why do you want to use VB? .net languages are the future of managed languages. Personally I'll stick with C++ and I'll never touch a VB or a VB look-alike such as VB.net.

I made a program in C# .net that does EXACLY what you described. But that was C# .net not VB.
ThoughT's Avatar
Computer Specs
Member with 94 posts.
 
Join Date: Aug 2004
Location: Ontario, Canada
Experience: Advanced
30-Oct-2005, 06:46 PM #3
well I kinda dont have C anything I would like to learn though.. maybe I'll have to aquire this programming environment somewhere..

would you show me or let me have your program? ;-)
aewarnick's Avatar
Senior Member with 839 posts.
 
Join Date: Sep 2002
30-Oct-2005, 08:41 PM #4
The source has a whole bunch of extra stuff in it I don't want to give out. Here is a snippet from my code:

PHP Code:
public void FillRunProc()
        {
            
Process[]PProcess.GetProcesses();
            
bool there=false;

            foreach(
Process p in P)
            {
                foreach (
string x in this.runProcLB.Items)
                {
                    if(
p.ProcessName==x)
                    {
                        
there=true;
                        break;
                    }
                }
                if(!
there)
                    
this.runProcLB.Items.Add(p.ProcessName);
                
there=false;
            }

            
there=false;
            
string[]listProc=new string[this.runProcLB.Items.Count];
            
this.runProcLB.Items.CopyTo(listProc0);

            foreach (
string x in listProc)
            {
                foreach(
Process p in P)
                {
                    if(
p.ProcessName==x)
                    {
                        
there=true;
                        break;
                    }
                }
                if(!
there)
                    
this.runProcLB.Items.Remove(x);
                
there=false;
            }
        }
//-----------------------
        
public void FillMarkedProc()
        {
            
this.markedProcLB.Items.Clear();
            
string[]mItemsthis.markedKey.GetValueNames();
            
this.markedProcLB.Items.AddRange(mItems);
        }
//-----------------------
        
public void KillProc()
        {
            
string[]mItemsthis.markedKey.GetValueNames();
            
Process[]PProcess.GetProcesses();

            foreach(
string x in mItems)
            {
                foreach(
Process p in P)
                {
                    if(
x.ToLower() == p.ProcessName.ToLower()) p.Kill();
                }
            }

            
UpdateForm();
        } 
ThoughT's Avatar
Computer Specs
Member with 94 posts.
 
Join Date: Aug 2004
Location: Ontario, Canada
Experience: Advanced
01-Nov-2005, 01:20 AM #5
thank you aewarnick, I'll see what I can do with this code :-D
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:28 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.