Jump to content

Recommended Posts

Posted

msgbox(0,"Found it",getfocus())
func getfocus()
    $var = WinList()
    For $i = 1 to $var[0][0]
    ; Only display visble windows that have a title
        If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
            If WinActive($var[$i][0]) Then
                return $var[$i][0]
            endif
        ;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])       
        EndIf
    Next
    seterror(1)
    return -1
endfunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

I dont think that you need some details..

-jaenster

  • 2 years later...
Posted

Sorry if i re take this old post,

Func and WinGetTitle("") work very well.

But i've a question. Is possible to return as applications identifier, .exe name ?

i use Italian version of xp, a lot of exe have name that can generate 'confusion'.

I read about class but also this item give me some limit for little tool that i want to build.

(mouse gesture tool, based on .exe, so anyone can build his macro)

Anyone can help me?

Thank you

m.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...