HermanCegel Posted January 3, 2023 Posted January 3, 2023 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 ?
Nine Posted January 3, 2023 Posted January 3, 2023 _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 Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
HermanCegel Posted January 3, 2023 Author Posted January 3, 2023 (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, 2023 by HermanCegel
SOLVE-SMART Posted January 4, 2023 Posted January 4, 2023 (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, 2023 by SOLVE-SMART ==> AutoIt related: 🔗 Organization AutoIt Community, 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet, 🔗 autoit-webdriver-boilerplate Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
HermanCegel Posted January 4, 2023 Author Posted January 4, 2023 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..
SOLVE-SMART Posted January 4, 2023 Posted January 4, 2023 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! ==> AutoIt related: 🔗 Organization AutoIt Community, 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet, 🔗 autoit-webdriver-boilerplate Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
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