This script is to get and attach process to CE.
Code: Select all
--- Process Handler
function GetTheProcessList()
local T = {}
local SL=createStringlist()
getProcesslist(SL)
for i=0,strings_getCount(SL)-1 do
T[i] = strings_getString(SL,i)
end
return T
end
function GetPros(sender)
local PL = GetTheProcessList()
local S = {}
local variable = drop.text
list.Clear()
for x = 0, #PL do
if variable == "All" then
list.Items.Add(PL[x])
else
if string.sub(PL[x],10) == variable then
--S[#S+1] = PL[x] --list for reference
list.Items.Add(PL[x])
end
end
end
end
function OpenPro()
local a = list.ItemIndex
if a ~= -1 then
local b = string.sub(list.Items[a],0,8)
b = tonumber(b,16)
openProcess(b)
else
showMessage("Process not found...")
return
end
end
Code: Select all
function KillPro()
local a = list.ItemIndex
if a ~= -1 then
local b = string.sub(list.Items[a],0,8)
b = tonumber(b,16)
shellExecute(string.format(b), '/c taskkill /PID ' .. getOpenedProcessID(), nil, false)
else
showMessage("Process not found...")
return
end
end
Thanks