Jump to content

how to find out wich window is acive?


Recommended Posts

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:

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

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