Jump to content

Recommended Posts

Posted

I was playing around with the processlist function and made a mini Task manager o.O But there is one thing i cant get to work or cant figure out how to do it is to close the selected file with the kill button. Here is the script so far.

#include <GUIConstants.au3>
#region; GUI Test Box
GUICreate("Test Box", 175, 300)

$Refresh = GUICtrlCreateButton("Refresh", 5, 265, 55)
$Kill = GUICtrlCreateButton("Kill", 65, 265, 45)
$Clear = GUICtrlCreateButton("Clear", 115, 265, 55)
$list = GUICtrlCreateList ("", 0,0,175,260)
GUICtrlSetLimit(-1,200)
GUISetState()
#endregion

#region; Varibles
$process = ProcessList()

#endregion

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    Select
        
    Case $msg = $Refresh
        For $i = 1 to $process[0][0]
            GUICtrlSetData($list,$process[$i][0] & $process[$i][1])
        Next
        
    Case $msg = $Clear
        GUICtrlSetData($list, "")
        
    Case $msg = $Kill
        ProcessClose($Kill)
    EndSelect
WEnd
Posted

In order to find out which process has been selected, you need to use GUICtrlRead, so

ProcessClose($Kill)

should be replaced by:

ProcessClose(GUICtrlRead($list))

  • 8 months later...
Posted

I am looking for a script that will automatically kill any non-windows processes that are currently running to free up cpu &/or memory for heavy applications or watching videos.

Anyone who does not wonder is either omniscient or foolish.

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
×
×
  • Create New...