Page 1 of 1

KillBill, vol. 1: find and close processes.

Posted: 10 Nov 2019, 16:12
by burque505
I frequently find myself with a host of unwanted processes list in Task Manager. Recently I created an infinite loop that started Firefox and was left with I-don't-have-a-clue-how-many instances of it running. Enough to eat all my system memory, at least. Killing them all in Task Manager was no fun. Thus this little utility.
It is ALPHA CODE and may sell your firstborn on the black market.

It hiccups often, but usually hitting "Clear" repeatedly mends things. Use with (lots of) caution.
(Seems to run better compiled)

Your comments are appreciated.
Spoiler
I'm sure you know where the name came from :D

Main screen - you can kill processes from here or after filtering. Either way, it requires SHIFT + DOUBLE-CLICK. Hit Clear afterward to be sure the LV updates!
MainScreen.PNG
MainScreen.PNG (74.42 KiB) Viewed 1509 times
Filtering for "conhost.exe" - you can kill a process the same way as you do from the main LV. Hit Clear afterward to be sure the LV updates!
filter.PNG
filter.PNG (36.55 KiB) Viewed 1509 times
Tray icon:
TrayIcon.PNG
TrayIcon.PNG (7.77 KiB) Viewed 1509 times
Have fun. Don't break anything.

Re: KillBill, vol. 1: find and close processes.

Posted: 10 Nov 2019, 18:08
by Hellbent
Very nice @burque505 :bravo:




But....


Expectation:
20191110180316.png
20191110180316.png (2.67 KiB) Viewed 1486 times

Reality:
20191110180337.png
20191110180337.png (1.28 KiB) Viewed 1486 times


1/10 :thumbdown:

:D

Re: KillBill, vol. 1: find and close processes.

Posted: 10 Nov 2019, 19:40
by boiler
@burque505 - Great name and icon!

@Hellbent - I'm with you that the whole flat design movement has gone too far. I mainly blame Jony Ive at Apple.

Re: KillBill, vol. 1: find and close processes.

Posted: 11 Nov 2019, 03:18
by Delta Pythagorean
Looks and works great, wouldn't mind a few things though.
An icon for each process, if no icon found, use the default program icon.
And a way to toggle processes that users can interact with. For example: An admin with full power can interact with anything, but a Guest account could only interact with specific processes. Toggling which programs they're able to interact with would be great.

These are at least some suggestions or whatever.

I think I might take this and create something similar with the Death Note design in mind. Just a little something that would tickle my fancy :P

Re: KillBill, vol. 1: find and close processes.

Posted: 14 Nov 2019, 15:53
by burque505
Thanks, you guys, for your comments. I'll look to incorporate some of the suggestions in the next version. I think next on the list will be a way to kill multiple selected processes at the same time.
@Hellbent, for me it looks like your "Expectation" in your post on Win7, but like your "Reality" on Win10. I'm not sure how I might fix that in a non-trivial fashion.
Regards,
burque505
P.S. I though i posted this 3 days ago, sorry!

Re: KillBill, vol. 1: find and close processes.

Posted: 08 Mar 2020, 12:49
by mikeyww
Here is something less fancy but works for visible windows. You can type part of a window title to select a row. Press ENTER to kill the window.

Code: Select all

; Kill a visible window
Process, Priority,, AboveNormal
SoundBeep, 1000, 40
; -------------------------------
exactMatchesToExclude = .Start.Program Manager. ; Separate exact window titles by "."
partialMatchesToExclude = ; Regular expression
lines := 0
; -------------------------------
WinGet, winArray, List ; Get unique ID numbers of all windows
Loop, %winArray% ; Loop through all windows
{
 winTitle := "ahk_id " . winArray%A_Index%
 WinGet, winStyle, Style, %winTitle% ; Get 8-digit hexadecimal number representing the window's style
 If (winStyle & 0x10000000) ; Window is visible
 {
  WinGetTitle, title, %winTitle% ; Get the window's title
  needle = .%title%.
  If (InStr(exactMatchesToExclude,needle)) OR ((partialMatchesToExclude > "") AND (RegExMatch(title,partialMatchesToExclude)))
   Continue
  If (title > "") ; Window has a non-null title
  {
   If (lines > 0) ; This window is not the first with a non-null title
    box .= "`t" ; Add a tab as a delimiter
   lines++
   box .= title ; Add the window title
  }
 }
}
Gui, Font, s10, Arial
Gui, Color, F9FF59
Gui +DelimiterTab +AlwaysOnTop -MinimizeBox -MaximizeBox
width := A_ScreenWidth - 400
Gui, Add, ListBox, w%width% r%lines% Sort vchoice, %box%
Gui, Add, Button, x+10 default w12, Kill ; Pressing ENTER will run subroutine "ButtonKill"
Gui, Add, Button, y+10 w12, Copy
Gui, Show, AutoSize Center, Visible windows (%lines%)
Return
; =============================
GuiEscape:
GuiClose:
ExitApp
Return
; -----------------------------
#IfWinActive Visible windows
^c::Gosub, ButtonCopy ; Press CTRL-C to copy the window title to the Windows clipboard
#IfWinActive
; -----------------------------
ButtonCopy:
ControlGet, text, Choice
Clipboard = %text%
Gui, hide
MsgBox, 64, Copied to Windows clipboard, %text%
Gui, show
Return
; -----------------------------
ButtonKill:
Gui, Submit
If (choice = "")
 ExitApp
MsgBox, 292, Confirm kill, %choice%
IfMsgBox Yes
{
 TrayTip, Killing, %choice%,, 1
 WinKill, %choice%
 Sleep, 1000
 ExitApp
}
Else
 Gui, show
Return

Re: KillBill, vol. 1: find and close processes.

Posted: 08 Mar 2020, 14:01
by burque505
Thanks for sharing that, @mikeyww. I'm sure many people will use it. I usually use KillBill for non-visible windows, orphaned conhost.exe, chrome.exe, cmd.exe and the like.
Regards,
burque505