HermanCegel 0 Posted January 3 Share Posted January 3 hello, i use _WinAPI_EnumProcessHandles to get many handles from a process ( a pid ) now from this handles i want to get it own pid, i dont know how to do that ? anyone can help ? Link to post Share on other sites
Nine 1,606 Posted January 3 Share Posted January 3 _WinAPI_GetProcessID “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to post Share on other sites
HermanCegel 0 Posted January 3 Author Share Posted January 3 (edited) but _winapi_getprocessid always return 0 here my script $aData = _WinAPI_EnumProcessHandles(15016) for $i = 1 to $aData[0][0] if $aData[$i][1] = '7' then $pid = _WinAPI_GetProcessID($aData[$i][0]) ;<= pid always 0 @_@ $aData[$i][0] is handle $aData[$i][1] = 'process with pid :' & $pid EndIf Next _ArrayDisplay($aData, '_WinAPI_EnumProcessHandles', '', Default, Default, 'Handle|Type|Attributes|Access') Edited January 4 by HermanCegel Link to post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 (edited) Hi @HermanCegel, I believe you mix things up. Are you talking about "handles" or "process IDs"? Your screenshots shows PIDs (green rectangle), or am I wrong? What do you want to do at the end? How to get process names can be done by simply ProcessList(). Maybe I missunderstood you or I miss something 🤔 ? #include-once #include <Array.au3> Global $aListOfProcesses = ProcessList() _ArrayDisplay($aListOfProcesses) It would be helpful if you described what you ultimately want to accomplish, because there could be multiple ways to get there. Best regardsSven________________Stay innovative! Edited January 4 by SOLVE-SMART Stay innovative! Spoiler 🌍 Au3Forums 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔍 Forum search 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to post Share on other sites
HermanCegel 0 Posted January 4 Author Share Posted January 4 hi @SOLVE-SMART greens rectangle show handles so processID : 796 (lsass.exe) have many handles that show in greens rectangle. that handle in greens rectangle is another process that "openprocess" by lsass.exe. what i want to know is how to get process name that "openprocess" by lsass.exe ? i only get it handles (green rectangle) but confuse how to convert from handles to pid to processname.. Link to post Share on other sites
SOLVE-SMART 110 Posted January 4 Share Posted January 4 Hi @HermanCegel, 8 minutes ago, HermanCegel said: [...] what i want to know is how to get process name that "openprocess" by lsass.exe ? i only get it handles (green rectangle) but confuse how to convert from handles to pid to processname [...] understood 👍 . I am in rush at the moment, maybe I will have a look later again. Best regardsSven________________Stay innovative! Stay innovative! Spoiler 🌍 Au3Forums 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔍 Forum search 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now