Sign in to follow this  
Followers 0
cracker

how to find out wich window is acive?

7 posts in this topic

hello i think i have a simple question and i hope you can help me.

my problem is that i want to know which window is active without checking every possible window with winwaitactive .... is it just possible to call a function or something like that an get back the title of the actually active window?

thank you a lot :whistle:

Share this post


Link to post
Share on other sites



hello i think i have a simple question and i hope you can help me.

my problem is that i want to know which window is active without checking every possible window with winwaitactive .... is it just possible to call a function or something like that an get back the title of the actually active window?

thank you a lot :whistle:

WinActive

WinGetState


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

MsgBox(64, 'Info:', WinGetTitle(""))


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi,

Opt("WinTitleMatchMode",4)

Opt("WinSearchChildren",1)

MsgBox(0,"", WinGetTitle("active"))

or

MsgBox(0,'', _WinGetActive())

Func _WinGetActive()
    $OptWSC = Opt('WinSearchChildren', 1)
    $aWinList = WinList()
    For $iCount = 1 To $aWinList[0][0]
        If $aWinList[$iCount][0] <> '' And WinActive($aWinList[$iCount][0]) Then
            Opt('WinSearchChildren', $OptWSC)
            Return $aWinList[$iCount][0]
        EndIf
    Next
    Opt('WinSearchChildren', $OptWSC)
    Return 0
EndFunc

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

Opt("WinTitleMatchMode",4)

Opt("WinSearchChildren",1)

MsgBox(0,"", WinGetTitle("active"))

or

MsgBox(0,'', _WinGetActive())

Func _WinGetActive()
    $OptWSC = Opt('WinSearchChildren', 1)
    $aWinList = WinList()
    For $iCount = 1 To $aWinList[0][0]
        If $aWinList[$iCount][0] <> '' And WinActive($aWinList[$iCount][0]) Then
            Opt('WinSearchChildren', $OptWSC)
            Return $aWinList[$iCount][0]
        EndIf
    Next
    Opt('WinSearchChildren', $OptWSC)
    Return 0
EndFunc

So long,

Mega

Lmao, that looks familiar :whistle:

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Yeah, :whistle: there are some scripts from you in my folder "nice funcs".

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

thanks that works perfekt!!!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0