Jump to content
Sign in to follow this  
cracker

how to find out wich window is acive?

Recommended Posts

cracker

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
Somerset

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
SmOke_N

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


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.

Share this post


Link to post
Share on other sites
Xenobiologist

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
SmOke_N

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:

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.

Share this post


Link to post
Share on other sites
Xenobiologist

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.