GordonFreeman Posted June 21, 2013 Share Posted June 21, 2013 (edited) Func _PIDGetWindowTitle($_PID = 0) Local $WList = WinList() For $i = 1 to $WList[0][0] If WinGetProcess($WList[$i][0]) = $_PID Then Return $WList[$i][0] EndIf Next EndFunc;_PIDGetWindowTitle EDIT: Ok,now,Func is right! Edited July 7, 2013 by GordonFreeman Frabjous Installation Link to comment Share on other sites More sharing options...
DW1 Posted June 21, 2013 Share Posted June 21, 2013 (edited) You are missing "Func " before the function name. EDIT: Also, if you are trying to go from PID to window name, shouldn't the returned value be "Return $WList[$i][0]" ? EDIT2: Haha, yeah no need for redundant wingettitle function, just return the title from the list Edited June 21, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
GordonFreeman Posted June 21, 2013 Author Share Posted June 21, 2013 (edited) Oh, ok, do not tell anyone right? The Remark of WinList Func If no title and text is given then all top-level windows are returned. The array returned is two-dimensional and is made up as follows: $array[0][0] = Number of windows returned $array[1][0] = 1st window title $array[1][1] = 1st window handle (HWND) $array[2][0] = 2nd window title $array[2][1] = 2nd window handle (HWND) ... $array[n][0] = nth window title $array[n][1] = nth window handle (HWND) I think the right now is: $WList[$i][0] Without a Func Thanks man! Edited June 21, 2013 by GordonFreeman Frabjous Installation 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