I don't know why no one thought of it before. I used vb6 to terminate certain programs such as iexplore.exe and many others of your choice the problem is that I need some more ideas.
I have devoloped a cool looking GUI with a rollover user control I made with some one else on the forum and backgrounds and button styles from Macromedia MX 2004. I just need other Ideas to finnish. (all open source)
The finnish product will feature the names of all who contributed. I will soon post the source and GUI. Take the source and post back the changes with your name so other can also modify it and I can list you so your not left out. You must only change one thing at a time and post the changes you added on the forum and attach the new source.
!!!Feel free to distribute it, but be fare and put your name as the version and list all those who helped!!! (!GIVE EVERYONE CREDIT!)
Thanks for your help,
...:::ONE:::...
Last edited by ...:::ONE:::...; Apr 5th, 2005 at 05:11 PM.
Dose it matter? Were Ever. I just wanted people to see this message.
As soon as i get home it will be here and we could start.
You In??
Sure.
My point though, it that it would be more noticable in the Code Bank. If you post it here it will eventually sink to the bottom of everything and people coming behind us that might benefit from it may not find it.
Ok i'll move it to the code bank, how do I do that or should a moderator do that.
I'm going to attach the files now.
I think it might need a new name. I don't know?
Its a good idea but I need some help.
For those who don't know what it is that i'm talking about, I wanted to make a program that could have good control over windows for example hWnd, Just common commands like a System shutdown timer, application terminator, closing apps and opening them on different times of the day, just lots of control over windows maybe hacks sort of like tweek xp but with tons of different things. You know stuff like that could come in handy for some people.
I'm almost a decade late but hey ho. I was just browsing around and saw this and thought I'd give my version of it:
Code:
Public Sub KillProcess(ByVal sProcessName As String)
' Kill process using Visual Basic 6 0 and WMI.
' The full .exe name (including the .exe) is supplied, but no path.
' Example: KillProcess "excel.exe"
' BE CAREFUL: No prompt for saving takes place.
' ALSO, it kills all occurrences.
Dim oWMI As Object
Dim ret As Long
Dim oServices As Object
Dim oService As Object
Dim sServiceName As String
'
On Error Resume Next
sProcessName = LCase$(sProcessName)
Set oWMI = GetObject("WinMgmts:")
Set oServices = oWMI.InstancesOf("win32_process")
'
For Each oService In oServices
sServiceName = LCase$(Trim$(CStr(oService.Name)))
'Debug.Print sServiceName
If sServiceName = sProcessName Then
ret = oService.Terminate
End If
Next
End Sub
Be careful though. That piece of code is very powerful. If you know the .EXE name of a process, you can kill about anything you want. Be careful though. If you do something like KillProcess "WinWord.exe", it'll kill Word with no prompt to save work or anything. It'll just be thrown out of memory.