Floooooo24 Posted July 8, 2024 Posted July 8, 2024 Hello, I have a List of PID, for which I need the Name. I don't kown the Name of what I want, so I make some examples: I want the Name "Spotify" from the Spotify App, and I have the ProcessID of the instance. Is this possible? Greetings Flo
Andreik Posted July 8, 2024 Posted July 8, 2024 If by name you mean to get the executable name then use _WinAPI_GetProcessFileName().
Floooooo24 Posted July 8, 2024 Author Posted July 8, 2024 Thank you, but sadly this dosn't help. The Executable name I already found by using ProcessList(). Any other way?
Andreik Posted July 8, 2024 Posted July 8, 2024 Sure, I will get my crystal ball to read your mind. Define what name are you talking about. KaFu 1
Floooooo24 Posted July 8, 2024 Author Posted July 8, 2024 Sry, I try to explain ist. I have some Code, which gets the PIDs and the Processnames of all Processes/Programms, which have an AudioSession. My Problem is, that this Proccesname kann look like this: "msedgewebview2.exe". But the Name I need, what hides behind this ist "Microsoft Teams".
Andreik Posted July 8, 2024 Posted July 8, 2024 Not even a crystal ball can do this. WebView2 is not used just by Teams but Widgets, Office, Outlook, Weather and many other applications. What you can try it's to find the window(s) associated with your process that are not owned and based on the window title you might figure out what kind of application it is. Anyway this is an inconsistent way to kinda solve what you want.
Solution KaFu Posted July 8, 2024 Solution Posted July 8, 2024 Is this of any help? #include <array.au3> #include <WinAPIProc.au3> Local $aProcessList = ProcessList() Global $aProcessList_Enhanced[UBound($aProcessList)][6] $aProcessList_Enhanced[0][0] = $aProcessList[0][0] For $i = 1 To $aProcessList[0][0] $aProcessList_Enhanced[$i][0] = $aProcessList[$i][0] $aProcessList_Enhanced[$i][1] = $aProcessList[$i][1] $aProcessList_Enhanced[$i][2] = _WinAPI_GetProcessFileName($aProcessList[$i][1]) $aProcessList_Enhanced[$i][3] = FileGetVersion($aProcessList_Enhanced[$i][2], "FileDescription") $aProcessList_Enhanced[$i][4] = FileGetVersion($aProcessList_Enhanced[$i][2], "InternalName") $aProcessList_Enhanced[$i][5] = FileGetVersion($aProcessList_Enhanced[$i][2], "ProductName") Next _ArrayDisplay($aProcessList_Enhanced) Floooooo24 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Floooooo24 Posted July 8, 2024 Author Posted July 8, 2024 Vielen Dank KaFu, bei Teams kann es zwar nicht helfen, aber bei allen anderen schon. Denn Rest muss ich vielleicht dann einfach mit einer eigenen Übersetzungs tabelle machen.
KaFu Posted July 8, 2024 Posted July 8, 2024 You're welcome 🙂. Maybe querying for the parent process and including elevated process is of any further help? #RequireAdmin #include <array.au3> #include <WinAPIProc.au3> Local $aProcessList = ProcessList() Global $aProcessList_Enhanced[UBound($aProcessList)][11] $aProcessList_Enhanced[0][0] = $aProcessList[0][0] For $i = 1 To $aProcessList[0][0] $aProcessList_Enhanced[$i][0] = $aProcessList[$i][0] $aProcessList_Enhanced[$i][1] = $aProcessList[$i][1] $aProcessList_Enhanced[$i][2] = _WinAPI_GetProcessFileName($aProcessList[$i][1]) $aProcessList_Enhanced[$i][3] = FileGetVersion($aProcessList_Enhanced[$i][2], "FileDescription") $aProcessList_Enhanced[$i][4] = FileGetVersion($aProcessList_Enhanced[$i][2], "InternalName") $aProcessList_Enhanced[$i][5] = FileGetVersion($aProcessList_Enhanced[$i][2], "ProductName") $aProcessList_Enhanced[$i][6] =_WinAPI_GetParentProcess($aProcessList_Enhanced[$i][1]) $aProcessList_Enhanced[$i][7] = _WinAPI_GetProcessFileName($aProcessList[$i][1]) $aProcessList_Enhanced[$i][8] = FileGetVersion($aProcessList_Enhanced[$i][7], "FileDescription") $aProcessList_Enhanced[$i][9] = FileGetVersion($aProcessList_Enhanced[$i][7], "InternalName") $aProcessList_Enhanced[$i][10] = FileGetVersion($aProcessList_Enhanced[$i][7], "ProductName") Next _ArrayDisplay($aProcessList_Enhanced) Floooooo24 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Floooooo24 Posted July 10, 2024 Author Posted July 10, 2024 No, I'm getting an Pid but no Path from the new Pid.😔
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