KillBill, vol. 1: find and close processes.

Post your working scripts, libraries and tools for AHK v1.1 and older
burque505
Posts: 1734
Joined: 22 Jan 2017, 19:37

KillBill, vol. 1: find and close processes.

10 Nov 2019, 16:12

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 2372 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 2372 times
Tray icon:
TrayIcon.PNG
TrayIcon.PNG (7.77 KiB) Viewed 2372 times
Have fun. Don't break anything.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

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

10 Nov 2019, 18:08

Very nice @burque505 :bravo:




But....


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

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


1/10 :thumbdown:

:D
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

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

10 Nov 2019, 19:40

@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.
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

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

11 Nov 2019, 03:18

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

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

burque505
Posts: 1734
Joined: 22 Jan 2017, 19:37

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

14 Nov 2019, 15:53

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!
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

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

08 Mar 2020, 12:49

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
Last edited by mikeyww on 08 Mar 2020, 15:05, edited 8 times in total.
burque505
Posts: 1734
Joined: 22 Jan 2017, 19:37

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

08 Mar 2020, 14:01

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
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

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

31 Jan 2021, 06:02

A quick question - how do you know which processes are safe to kill off? Just purely through research, or??
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
burque505
Posts: 1734
Joined: 22 Jan 2017, 19:37

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

31 Jan 2021, 08:27

@submeg, just through research, as you say. As mentioned, you can do some damage if you kill the wrong process. Be careful!
Regards,
burque505

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 174 guests