Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


help how to get process list for current user only

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
hmadaftw
How do I cheat?
Reputation: 0

Joined: 25 Dec 2021
Posts: 1

PostPosted: Sat Dec 25, 2021 10:51 pm    Post subject: help how to get process list for current user only Reply with quote

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)






Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites