Hi,
here a demo of a ce process selector.(fix a unnecessarily loop, should be better performance)
I added auto-select after thenewcomer's question
It is slow on my machine.
To test, execute the Lua Script Window.
Click the popup 'Click me' one time, wait a while (because low performance)
Another popup should show process list, click one non flash process for testing purpose.
The ce should select the process, and 1st popup should show the pid and name.
Click the popup again, this time no popup should show, and the 1st 'flash' process should be slected and attached.
This is to test for the autoAttach.
Check the usage inside the script.
gl~
========================
usage example:
pidDialog(doPid,autoSelectFirst,pn,dn)
---
doPid(pid,name,desc) - function to execute when the process is selected.
autoSelectFirst - type boolean or string
-- if boolean = true, select the 1st (highest weight) process from the list without display the process list box, even the process name is not in plugname or dllname, it may select svchost.exe if it is the 1st process enumerated;
-- if string, and is one of string inside dllname, it will not show the popup and return the 1st process with match *.dll from enumModule if possible. If such string is not found, the popup will still show;
-- in case not to select 1st process but manual select from popup, but also want to change the default plugname, dllname, set this as false or nil;
-- *this auto-select function may be more unreliable and lower performance as more process there(eg. user playing multiple unity instance of a game in different browser)
pn,dn -- these to modify the default plugname and dllname. If the respective type is table, the corresponding table is replaced ; if the type is string, the string is added to the table
eg.1
suppose cowon broswer or whatever has part of the module name as 'cowon', this added the weight of the cowon process in the list.
Code:
pidDialog(function(pid,...) end, false,'cowon')
eg.2 suppose there are 2 button to auto select 'chrome' unity and 'firefox' flash plugins, their respective call can be:
Code:
chrom-unity:
pidDialog(function(pid,...) end, 'unity',{'chrome'}) -- last is a table, so enumModule run on chrome process only, should be better performance
firefox-flash:
pidDialog(function(pid,...) end, 'flash',{"flashplayerplugin","plugin-container"})
for auto select some known *.exe,
Code:
pidDialog(function(pid,...) end, true,{"GxmOfWxrs.exe"}
... but it may be better use ce auto Attach function: getAutoAttachList().add("GxmOfWxrs.exe") at the beginning of the lua script
No +karma or thanks post please,
we shall exchange appreciation via telepathy ;)