Jump to content

Recommended Posts

Posted (edited)

AutoItWinGetTitle ( )

[edit] yeah.. probably not what you want...

Edited 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]

Posted

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]

Posted (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 by E1M1

edited

Posted

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]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...