>>>How would I go about killing a process from VB. Much like CTRL+ALT+DEL end task. I have several tasks I wish to be able to kill on demand.
>>>
>>>Ideally I would loop thru all the processes and kill any not on the 'approved' list. But, I dont know what to even begin to look this up under.
>>>
>>
>>If you can get the Process handle for the process, you can issue a TerminateProcess(); the problem lies in the mechanism for retrieving the processes which is platform-dependent. You might want to look at using the CreateToolhelp32Snapshot API call with Win9x or Win2K, and then wander through the snapshot using Process32First/Process32Next to retrieve the PROCESSENTRY32 structures, which contain detailed information about each process running at the time of the snapshot.
>>
>>TerminateProcess() is a messy shutdown; you'd be better off using SendMessage() to issue a WM_QUIT to the main window of the process, but there's no guarentee that the message will be accepted or executed. TerminateProcess() is an absolute kill, but has a tendency to leave .DLLs in an unpredictable state after their use.
>>
>>If you don't have access to an MSDN Library, get it - you're going to need this; process management from an app, especially in an NT or WIn2K envrionment, is not trivial.
>
>Thanks Ed, I am looking into this now. Some of the processes I need to kill do not have any visual components. I very much appreciate the info.
But they do have a WinMain in all probability that accepts Windows Messages; TerminateProcess() doesn't give a hoot about UI.