Jump to content

Recommended Posts

Posted (edited)

not sure what to do... I search around.

I found

If WinActive("[CLASS:Notepad]") Then
    MsgBox(0, "", "Window was active")
EndIf

Where it say Class:Notepad.. I am not sure what to put in there, I used Au3info.exe to find class, and this is what i found "Class:WindowsForms10.Window.8.app.0.ea7f4a_r11_ad1" looks kinda too long.

Where do i need to place these code?

Edited by frostchill
Posted

Maybe you can save current window handle and then restore it after ControlSend, but still it's annoying:

Local $hCurrentWin
While True
    If WinExists("Fiddler Web Debugger") Then
        $hCurrentWin = WinGetActive()
        WinActivate("Fiddler Web Debugger")
        ControlSend("Fiddler Web Debugger", "", "", "{s}")
        WinActivate($hCurrentWin[0])
    EndIf
    Sleep(1000)
WEnd

Func WinGetActive()
    Dim $window[2]
    Dim $winlist
    $winlist = WinList()
    For $i = 1 to $winlist[0][0]
        If $winlist[$i][0] <> "" AND IsVisible($winlist[$i][1]) Then
            $window[0] = $winlist[$i][0]
            $window[1] = $winlist[$i][1]
            ExitLoop
        EndIf
    Next
    Return $window
EndFunc

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

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...