Burgaud Posted May 18, 2021 Share Posted May 18, 2021 (edited) @Nine, Func FindTrueApp($sTitle, $iPID, ByRef $sProcess) Local Static $aList = _WinAPI_EnumWindows(True) Local $iTruePID For $i = 1 To $aList[0][0] If WinGetTitle($aList[$i][0]) = $sTitle Then $iTruePID = WinGetProcess($aList[$i][0]) If $iPID <> $iTruePID Then $sProcess = _WinAPI_GetProcessName($iTruePID) Return $iTruePID EndIf EndIf Next Return 0 EndFunc ;==>FindTrueApp Is there any particular reason why you used _WinAPI_EnumWindows instead of WinList? Also, why you used if WinGetTitle($aList[$i][0]) = $sTitle then instead of if $aList[$i][1] = $sTitle then Is there something else ? PS. I am still getting ApplicationFrameHost.exe if the process is Calculator.exe... Dan Edited May 18, 2021 by Burgaud Link to comment Share on other sites More sharing options...
Nine Posted May 18, 2021 Share Posted May 18, 2021 13 hours ago, Burgaud said: Is there any particular reason why you used _WinAPI_EnumWindows instead of WinList? I don't want to work with hidden windows and non apps windows. 13 hours ago, Burgaud said: Also, why you used if WinGetTitle($aList[$i][0]) = $sTitle then Because it is handle, better to search with it. 13 hours ago, Burgaud said: I am still getting ApplicationFrameHost.exe if the process is Calculator.exe... Working for me. “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
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