E1M1 Posted March 27, 2009 Share Posted March 27, 2009 How I can get window title if I know only Process_Name.exe ? edited Link to comment Share on other sites More sharing options...
SpookMeister Posted March 27, 2009 Share Posted March 27, 2009 (edited) AutoItWinGetTitle ( ) [edit] yeah.. probably not what you want... Edited March 27, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
E1M1 Posted March 27, 2009 Author Share Posted March 27, 2009 this command works only for autoit windows. edited Link to comment Share on other sites More sharing options...
SpookMeister Posted March 27, 2009 Share Posted March 27, 2009 heh.. well its a bit of a long way around.... but you could get the PID of the process with ProcessExists() Then get an array of all window titles from WinList, then go through each title that isn't "" and do a WinGetProcess() to compare PID's I'm sure there is a more elegant solution... I just don't know of it off hand. [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
E1M1 Posted March 27, 2009 Author Share Posted March 27, 2009 (edited) I dont like winlist() for this thing. I also tried google but I didn't find any help. then how I need another language(maybe). if so then can you recommend me some more keywords to search from google? I already tried(no needed source/command/function found) c++ how to get windows title from process c++ how to find window by process c++ how to find window by pid I also tried search from process and WinAPI functions from msdn. I remember I have seen script like I need in past, but I dont remember how it did that and where I saw it Edited March 27, 2009 by E1M1 edited Link to comment Share on other sites More sharing options...
Authenticity Posted March 27, 2009 Share Posted March 27, 2009 #627659To get the handle after you have the process ID. Link to comment Share on other sites More sharing options...
SpookMeister Posted March 27, 2009 Share Posted March 27, 2009 An example of what I was talking about in case you change your mind... It's not that tricky $return = _GetWinTitleFromProcName("SciTE.exe") ConsoleWrite($return & @CRLF) Func _GetWinTitleFromProcName($s_ProcName) $pid = ProcessExists($s_ProcName) $a_list = WinList() For $i = 1 To $a_list[0][0] If $a_list[$i][0] <> "" Then $pid2 = WinGetProcess($a_list[$i][0]) If $pid = $pid2 Then Return $a_list[$i][0] EndIf Next EndFunc ;==>_GetWinTitleFromProcName [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] 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