Jump to content

Active Task Killer (ATK)


Damein
 Share

Recommended Posts

Playing games and stuff can sometimes lead to the game freezing ect. and you can't use your mouse properly or see anything. So I thought of this and figured I'd release it for anyone else who might want to try it.

Simply, it will allow you to kill the process of your active window.

YouTube Demo: https://www.youtube.com/watch?v=Q_q5nUpakF4

GitHub: https://github.com/Tf2Prophete/ATK

 

Source:

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Imgs\Icon.ico
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_Res_Fileversion=1.2.0.0
#AutoIt3Wrapper_Res_LegalCopyright=R.S.S.
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <WinAPIConstants.au3>
; *** End added by AutoIt3Wrapper ***
;~ #AutoIt3Wrapper_Icon=Imgs\Icon.ico

#include <GUIConstantsEx.au3>

#include ".\Skins\Axis.au3"
#include "_UskinLibrary.au3"

_Uskin_LoadDLL()
_USkin_Init(_Axis(True))

Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 3)
Opt("TrayOnEventMode", 1)

Dim $Keys[33] = [32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, "-", "=", "`", "[", "]", ";", "'", ",", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"]
Dim $Alphabet[27] = [26, "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

Global $Modifier = "", $AltModifier, $CtrlModifier, $ShiftModifier, $HotKeyList, $CurrentHotKey = "", $HotKeyGui

$CurrentHotKey = IniRead(@ScriptDir & "/Data/Settings.ini", "Settings", "Hotkey", "NA")
HotKeySet($CurrentHotKey, "_Test")

$TrayMenuExit = TrayCreateItem("Exit...")
TrayItemSetOnEvent(-1, "_Exit")

$TrayMenuShowGui = TrayCreateItem("Show GUI...")
TrayItemSetOnEvent(-1, "_ShowGui")

_ShowGui()

Func _ShowGui()
    $HotKeyGui = GUICreate("Hotkey selection...", 400, 200)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGui")

    GUICtrlCreateLabel("Modifiers", 140, 50, 200, 40)
    GUICtrlSetFont(-1, 18)

    $HotKeyList = GUICtrlCreateCombo("", 10, 10, 380, 30)
    GUICtrlSetFont(-1, 11)

    For $i = 1 To $Keys[0]
        GUICtrlSetData($HotKeyList, $Keys[$i])
    Next

    For $i = 1 To $Alphabet[0]
        GUICtrlSetData($HotKeyList, $Alphabet[$i])
    Next

    $AltModifier = GUICtrlCreateCheckbox("Alt", 20, 60, 80, 80)
    GUICtrlSetOnEvent(-1, "_AltModifierSelected")
    GUICtrlSetFont(-1, 15)

    $CtrlModifier = GUICtrlCreateCheckbox("Ctrl", 335, 60, 80, 80)
    GUICtrlSetOnEvent(-1, "_CtrlModifierSelected")
    GUICtrlSetFont(-1, 15)

    $SubmitButton = GUICtrlCreateButton("Submit", 100, 140, 200, 50)
    GUICtrlSetOnEvent(-1, "_Submit")
    GUICtrlSetFont(-1, 15)


    GUISetState()
EndFunc   ;==>_ShowGui

Func _AltModifierSelected()
    If $Modifier = "!" Then
        GUICtrlSetState($CtrlModifier, $GUI_UNCHECKED)
        GUICtrlSetState($AltModifier, $GUI_UNCHECKED)
        $Modifier = ""
    Else
        $Modifier = "!"
        GUICtrlSetState($CtrlModifier, $GUI_UNCHECKED)
    EndIf
EndFunc   ;==>_AltModifierSelected

Func _CtrlModifierSelected()
    If $Modifier = "^" Then
        GUICtrlSetState($CtrlModifier, $GUI_UNCHECKED)
        GUICtrlSetState($AltModifier, $GUI_UNCHECKED)
        $Modifier = ""
    Else
        $Modifier = "^"
        GUICtrlSetState($AltModifier, $GUI_UNCHECKED)
    EndIf
EndFunc   ;==>_CtrlModifierSelected


Func _Submit()
    HotKeySet($CurrentHotKey)
    $HotKeySelected = GUICtrlRead($HotKeyList)
    $CurrentHotKey = $Modifier & $HotKeySelected
    HotKeySet($CurrentHotKey, "_Test")
    IniWrite(@ScriptDir & "/Data/Settings.ini", "Settings", "Hotkey", $CurrentHotKey)
EndFunc   ;==>_Submit

Func _Test()
    $Window = WinGetTitle("[ACTIVE]")
    $CheckCancel = MsgBox(4, "Kill...", "Do you wish to kill the following process?" & @CRLF & @CRLF & $Window)
    If $CheckCancel = 6 Then
        $Process = WinGetProcess($Window)
        ProcessClose($Process)
    Else
        Sleep(200)
    EndIf
EndFunc   ;==>_Test

Func _CloseGui()
    GUIDelete($HotKeyGui)
EndFunc   ;==>_CloseGui

Func _Exit()
    Exit
EndFunc   ;==>_Exit


While 1
    Sleep(10)
WEnd

 

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...