hmadaftw How do I cheat?
Reputation: 0
Joined: 25 Dec 2021 Posts: 1
|
Posted: Sat Dec 25, 2021 10:51 pm Post subject: help how to get process list for current user only |
|
|
Merry Christmas / Happy Holidays everyone.
I have two questions Help me find their solutions Please
1- Can i get processes list for current user only in this script
2-when i click on close (x) in the script its stay running in background processes , how to stop it ,close from background processes
| Code: |
function pidDialog(doPid)
local plugname = {"iexplore","flashplayerplugin","plugin-container","opera","chrome","awesomium_process","torch","dragon","maxthon","palemoon","safari" }
local function tmerge(t,o,...) for k,v in pairs(o) do t[k]=v end if select('#',...)>0 then return tmerge(t,...) else return t end end
local function callLater(f,...)
local a = {...}
local t = createTimer(nil,false)
t.Interval = 100
t.OnTimer = function(sender) sender.Enabled=false sender.Destroy() f(unpack(a)) end
t.Enabled = true
return t
end
local function parseProc(s)
return string.match(s,'(.-)%-(.*)')
end
local function prec(i,p,n)
local weight = 0
for _,v in ipairs(plugname) do
if string.find(string.lower(n),string.lower(v),1,true) then weight = weight + 1 end
end
return {pid=p,desc=string.format('%5d-%04X-%s',p,p,n),name=n,w=weight+i/2048}
end
local FP = createForm(false)
tmerge(FP,{FormStyle='fsStayOnTop',AutoSize=true,BorderWidth=4,Color=0x4795ED,Position='poScreenCenter',BorderStyle='bsToolWindow',Caption='Double Click to Select'})
local LB = createListBox(FP)
tmerge(LB,{MultiSelect=false,AutoSize=true,Color=0x4795ED})
local cs = LB.Constraints
tmerge(cs,{MinHeight=300,MinWidth=400})
local fn = LB.Font
tmerge(fn,{Color=0xffffff,Name='Courier New',Height=-16,Style='[bsBold]'})
LB.OnDblClick = function()
local idx,PID,NAME = LB.ItemIndex,nil,''
if idx >= 0 then
PID,NAME = string.match(LB.Items[idx],'(.-)%-.*%-(.*)')
PID = tonumber(PID,10)
callLater(doPid,PID,NAME)
FP.close()
end
end
FP.OnClose = function() FP.destroy(); FP = nil end
getProcesslist(LB.Items)
local plist = {}
for i=1,LB.Items.getCount() do
local p,n = parseProc(LB.Items[i-1])
p = tonumber(p,16)
table.insert(plist,prec(i,p,n))
end
table.sort(plist,function(a,b) return a.w > b.w end)
local currProcId = getOpenedProcessID()
for i=1,LB.Items.getCount() do
LB.Items.setString(i-1,plist[i].desc)
if plist[i].pid == currProcId then LB.setItemIndex(i-1) end
end
FP.show()
end
function CEButton1Click(sender)
pidDialog(function(pid,name)
OpenProcess(pid)
UDF1.CELabel1.Caption = string.format('%4X-%s',pid,name)
end)
end
function exitT()
closeCE();
return caFree
end
form_onClose(UDF1, ExitT)
|
|
|